🎉 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!
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.)
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:
You can also use the
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)
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)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement