🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

python

Started by
1 comment, last by gowron67 21 years, 9 months ago
anyone know how to invoke an executable from a python script ?
Advertisement
import os
os.system("command")

You can use the platform variable in sys to tell you which OS is running (and change the shell commands to fit it.)
Or more generally:

  import osoutstream = os.popen( "somefile.exe" )retval = outstream.close()#or this:retval = os.popen( "somefile.exe" ).close()  

You can also use the popen2 and popen3 functions, also in the os module. They give you more access to the output, error and input streams of the process.


The world holds two classes of men -- intelligent men without religion, and religious men without intelligence.


  Abu''l-Ala-Al-Ma''arri (973-1057; Syrian poet)
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement