Execute external program
jamie.carl at salientnetworks.com.au
Fri Mar 22 05:53:23 CET 2002
brilliant! Knew it'd be easy.
"Emile van Sebille" <emile at fenx.com> wrote in message
news:a7e3c1$kldi4$1 at ID-11957.news.dfncis.de...
> "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
> > external program such as 'bash' or whatever?
> > Is there a line of code that will do this. No interface with STDIO
> > so i can run blind.
> ActivePython 2.1, build 210 ActiveState)
> based on Python 2.1 (#15, Apr 19 2001, 10:28:27) [MSC 32 bit (Intel)] on
> 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.
> Emile van Sebille
> emile at fenx.com
More information about the Python-list