running programs from within python

Steven Bethard steven.bethard at gmail.com
Wed Mar 9 12:06:37 EST 2005


M.N.A.Smadi wrote:
> M.N.A.Smadi wrote:
> 
>> hi;
>> in general: how can i pass a string containing a concatenated sequcne 
>> of command line arguments to a unix system CLI?
> 
> 
> i guess i will answer myself:
> import os
> os.system(string)

Also worth noting is that if you're using Python 2.4, you might want to 
look at the subprocess module, which replaces many of the older os.* 
calls with a more flexible interface.  For the os.system replacement, see:

http://docs.python.org/lib/node235.html

STeVe



More information about the Python-list mailing list