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


Groups > comp.lang.python > #33977

RE: os.popen and the subprocess module

From "Prasad, Ramit" <ramit.prasad@jpmorgan.com>
Subject RE: os.popen and the subprocess module
Date 2012-11-27 18:27 +0000
References <op.wof1nunc23fxu8@drewx-pc>
Newsgroups comp.lang.python
Message-ID <mailman.317.1354040887.29569.python-list@python.org> (permalink)

Show all headers | 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