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


Groups > comp.lang.python > #33977

RE: os.popen and the subprocess module

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ramit.prasad@jpmorgan.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'essentially': 0.04; 'output': 0.04; 'completeness': 0.07; 'executable': 0.07; 'received:155': 0.09; 'subject:module': 0.09; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'subprocess': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'wrote:': 0.17; 'implementing': 0.17; 'module,': 0.17; 'to:name :python-list@python.org': 0.20; 'runs': 0.22; 'to:2**1': 0.23; 'received:169.254': 0.24; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'accuracy': 0.27; 'andrew': 0.27; 'run': 0.28; 'received:169': 0.29; "i'm": 0.29; 'usually': 0.30; 'url:python': 0.32; 'anyone': 0.33; 'to:addr:python-list': 0.33; 'but': 0.36; 'url:org': 0.36; 'data.': 0.36; 'url:library': 0.36; 'well.': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'help': 0.40; 'easy': 0.60; 'hear': 0.63; 'information,': 0.63; 'url:email': 0.63; 'legal': 0.65; 'subject': 0.66; 'purchase': 0.67; 'analysis': 0.70; 'sale': 0.76; 'received:169.254.8': 0.84; 'to:addr:yahoo.co.uk': 0.84; 'analyses': 0.91
X-DKIM OpenDKIM Filter v2.1.3 sz2.jpmchase.com qARIS2Lu018889
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1354040883; bh=cJ+SHzWgxC3BxpYppIYKAzpuUN41YZyu77NtYhL6rXk=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=YHfJ0XVTwl5FKrh1ZFHaOJyfAoxa7+IU4lKIQHupkKS4n0JSxpykcoWr31H28E6zX gEpQR2AXb3zU8B7NKVwVCU+QdmQEN7Z4sB0/U52WZ0CTmQPLOV5h0R8ns+7hoAlIg3 M9QoWTH/LaErX0HxKT0gOwNYOnkvH4n7eQfulZJQ=
From "Prasad, Ramit" <ramit.prasad@jpmorgan.com>
To Andrew <drew00andy@yahoo.co.uk>, "python-list@python.org" <python-list@python.org>
Subject RE: os.popen and the subprocess module
Thread-Topic os.popen and the subprocess module
Thread-Index AQHNzMs0Jt1fNlvdp0CazHLsRnOJkZf9/yZw
Date Tue, 27 Nov 2012 18:27:52 +0000
References <op.wof1nunc23fxu8@drewx-pc>
In-Reply-To <op.wof1nunc23fxu8@drewx-pc>
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [10.67.79.47]
Content-Transfer-Encoding base64
MIME-Version 1.0
X-DLP-FWD Yes
Content-Type text/plain; charset="utf-8"
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.317.1354040887.29569.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1354040887 news.xs4all.nl 6874 [2001:888:2000:d::a6]:34770
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33977

Show key headers only | View raw


Andrew wrote:
> 
> Hello world,
> 
> I'm working on a script that will run an executable obtaine the output
>  from the executable
> and do some analysis on the output. Essentially the script runs the
> executable analyses
> the data.
> I'm looking into os.popen and the subprocess module, implementing os.popen
> is easy but i hear
> it is depreciating  however I'm finding the implemantation of subprocess
> daunting can anyone help
> 

Have you read the documentation?

http://docs.python.org/library/subprocess.html#replacing-older-functions-with-the-subprocess-module
(specifically 17.1.4.5)

This may help as well.
http://www.doughellmann.com/PyMOTW/subprocess/#capturing-output

Note, use of shell=True is usually discouraged as it can be
unsafe.


~Ramit



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

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


Thread

RE: os.popen and the subprocess module "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-27 18:27 +0000

csiph-web