Get Stdout from external script startet through python

Wojtek Walczak gminick at hacker.pl
Sat Nov 16 09:53:28 EST 2002


Dnia Sat, 16 Nov 2002 12:40:30 +0100, Christian Rapp napisał(a):
> I need to start an external script from inside python. This works just fine.
> The called script produces some output on StandardOut, that I need within
> the python-script. How do I get this Output into python?

>>> import os
>>> print os.popen.__doc__
popen(command [, mode='r' [, bufsize]]) -> pipe
Open a pipe to/from a command returning a file object.
>>> a = os.popen("/bin/date")
>>> print a.read(),
Sat Nov 16 19:42:59 CET 2002
>>> a.close()

Is that what you wanted ?

-- 
[ Wojtek gminick Walczak ][ http://gminick.linuxsecurity.pl/ ]
[ gminick (at) hacker.pl ][ gminick (at) underground.org.pl  ]



More information about the Python-list mailing list