[Tutor] subprocess/files help

Lie Ryan lie.1296 at gmail.com
Thu Jun 11 08:25:16 CEST 2009


Essah Mitges wrote:
> game runs fine out of the WODDS.py it when I start it from the menu lies the problemup-1.png is the first pic file used in the program so I'm guessing that all of the imported files from data have a problem if i took away up-1 up-2 would start a problem then side-1 and so on
> 

Let me guess, the menu script is in different directory than the game
script? The current working directory is thus pointing to the menu's
directory instead of script's.

Two possible fix is to 1) move the menu script to the game's script
directory or 2) pass cwd="" argument to subprocess.Popen

However, as others have said, both of them are the WRONG approach to
your problem... since both scripts are python scripts, both under your
control, and most importantly both scripts are integrated part of a
unity (i.e. the game); it will be MUCH easier to import the game script
and call the function that started the game.



More information about the Tutor mailing list