how to execute .exe file ?

Q

quiteblack

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 ?
 
L

Larry Bates

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top