views:

20

answers:

1

I'm trying to execute a command which runs a program that uses perl and python. Although both of them are already in PATH, I get this error 'perl' is not recognized as an internal or external command,operable program or batch file. 'python' is not recognized as an internal or external command,operable program or batch file. So I tried os.putenv('PATH', dir) but only one was taken in.

A: 

So try

os.putenv('PATH', dir + ";" + otherdir)
Pēteris Caune
Thanks but why couldn't Python recognise the programs even though they were already in the environment variables?
BiX
Apparently they were not... I'd suggest to put some debugging statements like "print os.environ" in your code to see what's going on.
Pēteris Caune