how to execute .exe file ?

Larry Bates larry.bates at websafe.com
Tue Oct 11 11:17:32 EDT 2005


There are several ways.  The easiest is to use
os.system('program.exe')

If you require more control on the output, etc.
take a look at popen and the new subprocess modules.

A more complex method that is mostly for Windows GUI applications
and allows finer grain control over window size, environment, etc.
is the win32process.CreateProcess module which is part of the
win32 extensions by Mark Hammond.  This requires a bit more work,
but gives you control over almost every aspect of a Windows GUI
application window at startup.

-Larry Bates

quiteblack at gmail.com wrote:
> hi all~
> 
> i used to drive .exe file working by writing a simple batch file, i
> thin python may do this as well bu i dunno how to, any help ?
> 



More information about the Python-list mailing list