[Tutor] gui

Lie Ryan lie.1296 at gmail.com
Wed Jun 10 05:24:48 CEST 2009

Essah Mitges wrote:
>    1.
>       Traceback (most recent call last):
>    2.
>         File "C:\Users\John Doe\Desktop\D-Day\back.py", line 47, in <module>
>    3.
>           main()
>    4.
>         File "C:\Users\John Doe\Desktop\D-Day\back.py", line 37, in main
>    5.
>           elif sbut.clicked(k.pos):
>    6.
>         File "C:\Users\John Doe\Desktop\D-day\but.py", line 200, in clicked
>    7.
>           subprocess.Popen(["D-Day", "Destruction.py"])
>    8.
>         File "C:\Python26\lib\subprocess.py", line 595, in __init__
>    9.
>           errread, errwrite)
>   10.
>         File "C:\Python26\lib\subprocess.py", line 804, in _execute_child
>   11.
>           startupinfo)
>   12.
>       WindowsError: [Error 2] The system cannot find the file specified
> The error in readable form

Readable doesn't mean it have to be colored and line numbered, although
this is more readable than the previous one -- at least on a newsreader
that supports HTML -- it's better to keep messages in plain text (i.e.
not only unformatted text but change the newsreader's settings to pure,
plain text)

All right to the problem, the problem is not related to pygame at all;
it's in your subprocess.Popen() call. The traceback says that
subprocess.Popen cannot find the executable/script that would be run.

A quick look at the traceback:
subprocess.Popen(["D-Day", "Destruction.py"])

That line is executing an executable/script named "D-Day" and pass an
argument "Destruction.py" to it. Probably not something you wanted to
do. What you want to do is something like:


or perhaps:
subprocess.Popen(["python", "D-Day\Destruction.py"])

depending on whether the file association is setup correctly and whether
the shell's search path is set to search python's install directory.

More information about the Tutor mailing list