[Tutor] How to launch executable from a Python script??

Alan Gauld alan.gauld at freenet.co.uk
Wed Nov 9 22:56:39 CET 2005


> sure how to do it on a windows box since the file is an executeable.  

> os.chdir('spacinVaders-0.1')   #switch to the game's directory
> os.spawnlp(os.P_NOWAIT, 'pythonw', 'pythonw', 'play.py')
> 
> and it would launch fine.... can someone help me with this??

You should be able to use os.system. possibly utilisoing the 
Windows START command if you dont want it to block until 
the program finishes - at least I think thats what START does!

Alan G.


More information about the Tutor mailing list