shell command output

Erik Max Francis max at alcyone.com
Mon May 21 01:44:25 EDT 2001


Sorin Gherman wrote:

> Is there any solution to avoid the temp file?

Yep, use popen:

max at oxygen:~% python
Python 2.0 (#2, Apr  4 2001, 19:28:30) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import os
>>> print os.popen.__doc__
popen(command [, mode='r' [, bufsize]]) -> pipe
Open a pipe to/from a command returning a file object.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ We grow in time to trust the future for our answers.
\__/ Ruth Benedict
    REALpolitik / http://www.realpolitik.com/
 Get your own customized newsfeed online in realtime ... for free!



More information about the Python-list mailing list