Calling an exe from Python?

Sam Pointon free.condiments at gmail.com
Sun Oct 16 16:35:40 EDT 2005


from subprocess import Popen
proc = Popen('my_programme.exe')

Use proc.communicate(input) to send input to stdin, and get a tuple of
(stdout, stderr) back. If you need the returncode, use proc.poll() or
proc.wait(), depending on if you want it to block or not.




More information about the Python-list mailing list