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

Pujo Aji ajikoe at gmail.com
Wed Nov 9 00:08:15 CET 2005


Try to add .py in PATHEXT environment windows XP
After that, you can call your python program just like you call exe file.
 Hope this help.
pujo

 On 11/8/05, Chris Irish <chris.irish at libertydistribution.com> wrote:
>
> Hello all :)
> I made a GUI app with pyGTK that I want to be able to launch a game I've
> downloaded from the pygame website when a button is clicked. I was able
> to do this on a linux box since the file was a .py file, but I'm not
> sure how to do it on a windows box since the file is an executeable. On
> linux I did this:
>
> import os
> olddir = os.getcwd() #to keep a reference to the old
> directory to switch games later
> 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??
>
> Thanks in advance..... Chris :P
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20051109/d5f1bf1d/attachment.htm


More information about the Tutor mailing list