grayaii schrieb: > There are so many threads on this subject, but I ran across a > situation on Windows that I can't figure out. > > I'm trying to run this little command-line exe and when I launch like > this, it hangs: > >>>> import subprocess >>>> command = r'c:\mydir\foo.exe' >>>> run = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, >>>> stdin=None, stderr=subprocess.PIPE, env=os.environ, >>>> universal_newlines=True) >>>> returncode = run.wait() ## HANGS HERE ##
The code blocks because you aren't reading from stdout and stderr. Use the communicate() method instead of wait(). Christian -- http://mail.python.org/mailman/listinfo/python-list