I\'m writing a programme that needs to run on both Linux and Windows and use executables (with parameters) that exist in the path. (Assumed)
Currently I\'m having tr
You can control the environment variables available in the spawned subprocess by passing a mapping with the env keyword argument. E.g.
proc = subprocess.Popen(args, env={'PATH': '/some/path'})
Or to inherit PATH from the system environment variable, without necessarily chucking in everything else from the system environment:
proc = subprocess.Popen(args, env={'PATH': os.getenv('PATH')})
It might be easier/simpler just to use an absolute path, though.