os.popen and the subprocess module

Prasad, Ramit ramit.prasad at jpmorgan.com
Tue Nov 27 13:27:52 EST 2012


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.  


More information about the Python-list mailing list