Passing arguments to a command line from a python script

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Mar 20 01:25:45 CET 2007


En Mon, 19 Mar 2007 20:46:56 -0300, Luis M. González <luismgz at gmail.com>  
escribió:

> What I want now is execute the script I just created.
> As far as I know, the only way to execute the script is from a command
> line and typing "setup.py py2exe".

A few ways:
- os.system("commandline"). Simplest way, but you don't have much control,  
and it blocks until the process finishes.
- os.popen[234]? or the functions in the popen2 module
- the subprocess module - the most complete way, but simple enough for  
most cases.

-- 
Gabriel Genellina




More information about the Python-list mailing list