0
我想用一个外部程序我通常在bash终端使用到蟒蛇功能
这项计划是在我的.bashrc中添加:
PATH=$PATH:/the/dir/containing/my_prog
所以在我的终端,我可以运行:
my_prog arg1
我怎样才能在巨蟒,运行(与os.system()
或subprocess
如)my_prog
?
因为.bashrc
必须先读取,我无法加载它。
my_prog
利用自身在.bashrc $PATH
定义了一些其他progs的,这就是为什么它必须被加载...
感谢您的帮助!
你的意思是你想要一个解析器,它在Python脚本中读入'.bashrc'并正确设置PATH变量? – tamasgal 2014-12-19 08:48:09