Using os.popen with other python scripts

skott1870 at my-dejanews.com skott1870 at my-dejanews.com
Tue May 4 12:32:55 EDT 1999


I'm having trouble using os.popen within a script to capture the output of
another script.
For example:

Script 1:

print "this is a test"

Script 2:

import os
x = os.popen('script1.py').readlines()
print x

Script2's output is just an empty list. I'm working on an NT system, through a
dos window.
Does anyone know what could be causing this behavior?

Thanks,
TST

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




More information about the Python-list mailing list