[Tutor] mamelauncher

Alan G alan.gauld at freenet.co.uk
Mon Sep 12 22:53:44 CEST 2005


> import os
> 
> def run_mame_selection(selection):
>    os.system("C:\\mame096b\\mame.exe"+""+selection)
> 
> #main
> mine = "pacman"
> run_mame_selection(mine)    
> 
> What I get is like a brief flash of the CMD prompt

Open the command prompt first and run it from there.
(Or add a raw_input() line at the end.
We need to know what the error message looks like.
But it sounds like the problem is in the system call 
not your GUI stuff.

> try re-writing using sub-process as I've upped my
> Python to 2.4.

That might help but the system() call should work too, so 
I'd stick with it till we figure out whats happening.

HTH,

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld


More information about the Tutor mailing list