Thanks for trying out and fix the typo (Outlook loves to capitalize the
first letter)
 
My environment is Windows 2000, and I was running from Eclipse.
To follow your example, I tried to run them from command prompt, and I
got
C:\temp\x>aa.py
in C:\temp\x\aa.py
in C:\temp\x\bb.py
in C:\temp\x\cc.py
executingh cc.py 0
executingh bb.py 0
 
So it works.
 
But when I tried again to run them from eclipse. I got only
in C:\temp\x\aa.py
in C:\temp\x\bb.py
executingh cc.py 0
executingh bb.py 0
 
The "in C:\temp\x\cc.py" never get printed And some of my more
complicated real example shows cc.py never run. Will this be a problem
with Pydev?
Thank you


________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James Matthews
Sent: Wednesday, December 06, 2006 9:08 PM
To: Tim Roberts
Cc: Python-Win32 List
Subject: Re: [python-win32] Question about os.system


Try Exec with the file handle


On 12/6/06, Tim Roberts <[EMAIL PROTECTED]> wrote: 

        Wu, Huaxing (STP) wrote:
        >
        > 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?
        >
        
        Works for me in Windows XP, once I fixed your print/Print
confusion.
        What environment are you in?
        
        C:\tmp\x>type aa.py
        import os
        print "in", __file__ 
        sysCode = os.system("bb.py")
        print "executing bb.py ", sysCode
        
        C:\tmp\x>type bb.py
        import os
        print "in", __file__
        sysCode = os.system("cc.py")
        print "executing cc.py ", sysCode
        
        C:\tmp\x>type cc.py
        import os
        print "in", __file__
        
        C:\tmp\x>python aa.py
        in aa.py
        in C:\tmp\x\bb.py
        in C:\tmp\x\cc.py
        executing cc.py  0
        executing bb.py   0
        
        C:\tmp\x>
        
        --
        Tim Roberts, [EMAIL PROTECTED]
        Providenza & Boekelheide, Inc.
        
        _______________________________________________
        Python-win32 mailing list 
        Python-win32@python.org
        http://mail.python.org/mailman/listinfo/python-win32
        




-- 
http://www.goldwatches.com 
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to