[wingide-users] Output out of order when calling python from Wing IDE

Rick rjm40 at optonline.net
Sat Mar 28 10:35:12 MDT 2009


I'm using Wing IDE Personal 3.1.8-1 (Rev 19913), and I ran across a 
problem when using the python subprocess module:  Within the IDE the 
output from a called python program can appear before the output from an 
earlier print statement.

Here are two python scripts to demonstrate:

# first.py
import subprocess
print "This is first!"
subprocess.call(["python", "second.py"])

# second.py
print "This is second!"

When I evaluate first.py from within the IDE, I get this output:

Python 2.5.2 (r252:60911, Feb 11 2009, 08:16:01)
[GCC 4.1.2 (Gentoo 4.1.2 p1.1)]
Type "help", "copyright", "credits" or "license" for more information.
Evaluating first.py
This is second!
This is first!

This is not what is expected.  Running first.py from a terminal results 
in the expected output:

$ python first.py
This is first!
This is second!

Of course I get the same results when calling with os.system().

This problem does not appear when run through the debugger or when the 
called process is something other than python.  Can this be fixed?


More information about the wingide-users mailing list