我有以下主管程序配置:
[program:showvars]
environment=TESTVAR=hi,PYTHONPATH=/home/eric/python/tools/
command=python /home/eric/showvars.py
showvars.py 只是循环遍历环境变量并打印它们的值:
import os
for param in os.environ.keys():
print "%20s %s" % (param,os.environ[param])
我得到以下(删节的)输出:
TESTVAR hi
PYTHONPATH /
什么可能会重置我的 PYTHONPATH?
答案1
用引号括住路径可以解决此问题:
[program:showvars]
environment=TESTVAR=hi,PYTHONPATH='/home/eric/python/tools/'
command=python /home/eric/showvars.py