【发布时间】:2018-11-05 20:58:06
【问题描述】:
python 可执行文件是“/path/A/B/python”。但不幸的是,我需要获取一个文件并导出一些环境变量以使该可执行文件可运行。
所以我想定义我自己的“解释器”,比如/home/name/mypython
#!/bin/bash
source something
/path/A/B/python
并将上述脚本包含在 python 文件的 shebang 中
#!/home/name/mypython
## rest of the python script
但不幸的是它不起作用。它只是把我带到一个 python shell 而不做任何事情。我还应该做什么?
【问题讨论】: