views:

175

answers:

2

I'm trying to make a python script run another program from its own path. I've got the execution of the other program working using os.system, but the program will crash because it cannot find its reasources (wrong path, I assume). I tried adding the folder harboring the executable to the path, but that didn't help.

Any help please?

+2  A: 

You can change the current directory of your script with os.chdir(). You can also set environment variables with os.environ

Ned Batchelder
+1  A: 

Use the subprocess module, and use the cwd argument to set the child's working directory.

retracile
This worked also
quano