Execute external program

Emile van Sebille emile at fenx.com
Thu Mar 21 20:56:30 EST 2002


"Jamie Carl" <jamie.carl at salientnetworks.com.au> wrote in message
news:3c9a7d0e_1 at news.iprimus.com.au...
> Hopefully this is a simple question.  How can I get python to execute
an
> external program such as 'bash' or whatever?
> Is there a line of code that will do this.  No interface with STDIO
needed
> so i can run blind.
>

C:\>python
ActivePython 2.1, build 210 ActiveState)
based on Python 2.1 (#15, Apr 19 2001, 10:28:27) [MSC 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('dir')
 Volume in drive C is DISK2PART01
 Volume Serial Number is 36C1-7E27

You should also look into spawn and pipe variants.

HTH,

--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list