Execute external program

Jamie Carl jamie.carl at salientnetworks.com.au
Thu Mar 21 23:53:23 EST 2002


brilliant!  Knew it'd be easy.

J

"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
> 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