[python-win32] Question about os.system

Wu, Huaxing (STP) huaxing.wu at guidant.com
Thu Dec 7 00:42:24 CET 2006


Hi, all,

I have some problem using os.system when a command that spawned by
os.system itself tries to use os.system. It may be easier to explain
with an example.

Assume I have 3 python scripts. They are aa.py, bb.py and cc.py.
File aa.py (Try to run bb.py using os.system)
import os
print "in", __file__
sysCode = os.system("bb.py")
Print "executing bb.py ", sysCode

File bb.py (try to run cc.py using os.system)
import os
print "in", __file__
sysCode = os.system("cc.py")
Print "executing cc.py ", sysCode

File cc.py
import os
print "in", __file__

On command line, run "aa.py"

And cc.py never get run. Is there anything wrong in the code?

Thank you.
Huaxing



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20061206/1b7db097/attachment.html 


More information about the Python-win32 mailing list