Calling an exe from Python?

Sam Pointon free.condiments at
Sun Oct 16 22:35:40 CEST 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