Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32263

Re: how to change os.popen4 to subprocess

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'deprecated': 0.07; 'scripts': 0.09; 'python': 0.09; 'indicates': 0.09; 'porting': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'suggest': 0.11; '2.7.3': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subprocess': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'module': 0.19; 'versions': 0.20; 'trying': 0.21; 'thanks.': 0.21; 'this:': 0.23; 'specifically': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '[1]': 0.27; 'header:X-Complaints-To:1': 0.28; 'piece': 0.29; "i'm": 0.29; 'code': 0.31; 'problem.': 0.32; 'url:python': 0.32; 'anybody': 0.32; 'from:addr:yahoo.co.uk': 0.32; 'subject:change': 0.33; 'to:addr:python-list': 0.33; 'tutorial': 0.33; 'hi,': 0.33; 'received:org': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'problems': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'some': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'most': 0.61; "you've": 0.61; 'first': 0.61; 'url:index': 0.61; 'here': 0.65; 'talking': 0.66; 'case?': 0.84; 'received:2': 0.91; 'url:tutorial': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: how to change os.popen4 to subprocess
Date Sat, 27 Oct 2012 04:10:33 +0100
References <c6bac1cc-abda-4d95-b3b4-e96dc7ab7a3a@r8g2000pbs.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-2-98-194-32.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.0; rv:16.0) Gecko/20121010 Thunderbird/16.0.1
In-Reply-To <c6bac1cc-abda-4d95-b3b4-e96dc7ab7a3a@r8g2000pbs.googlegroups.com>
X-Antivirus avast! (VPS 121026-1, 26/10/2012), Outbound message
X-Antivirus-Status Clean
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2929.1351307261.27098.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1351307261 news.xs4all.nl 6856 [2001:888:2000:d::a6]:51415
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:32263

Show key headers only | View raw


On 27/10/2012 03:28, skyworld wrote:
> Hi,
>
> I'm new to python and I'm trying to porting some scripts from v0.96 to
> v2.0.1. A piece of code is like this:

What software are you talking about here, it's certainly not Python 
versions as the most up to date are 2.7.3 and 3.3.0?

>
> cmd_h = os.popen4(env['SYSCMDLINE'])[1]
>
> the system indicates the popen4 is deprecated and suggest to use
> subprocess. Can anybody tell me how to use subprocess in this case?
> and what does "[1]" here means?

If you don't know what the [1] means you've got problems :)  I suggest 
you read the tutorial here first 
http://docs.python.org/tutorial/index.html then the subprocess module 
here http://docs.python.org/library/subprocess.html#module-subprocess, 
specifically 
http://docs.python.org/library/subprocess.html#subprocess-replacements

>
> thanks.
>

No problem.

-- 
Cheers.

Mark Lawrence.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

how to change os.popen4 to subprocess skyworld <chenyong20000@gmail.com> - 2012-10-26 19:28 -0700
  Re: how to change os.popen4 to subprocess MRAB <python@mrabarnett.plus.com> - 2012-10-27 04:02 +0100
    Re: how to change os.popen4 to subprocess skyworld <chenyong20000@gmail.com> - 2012-10-26 23:30 -0700
      RE: how to change os.popen4 to subprocess "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-30 14:47 +0000
  Re: how to change os.popen4 to subprocess Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-27 04:10 +0100

csiph-web