2010-10-26 62 views
0

我試圖執行一個運行使用perl和python的程序的命令。雖然他們都已經在PATH中,我得到這個錯誤'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.所以,我想os.putenv('PATH', dir),但只有一人當。Python:需要再次添加執行的現有環境變量

回答

0

所以儘量

os.putenv('PATH', dir + ";" + otherdir) 
+0

謝謝,但爲什麼不能Python的,即使他們承認程序已經在環境變量? – BiX 2010-10-29 03:18:05

+0

顯然他們不是......我建議在你的代碼中加入一些調試語句,比如「print os.environ」,看看發生了什麼。 – 2010-10-29 07:36:30