![在 WSL Ubuntu 18.04 中使 Python 脚本可执行](https://linux22.com/image/914883/%E5%9C%A8%20WSL%20Ubuntu%2018.04%20%E4%B8%AD%E4%BD%BF%20Python%20%E8%84%9A%E6%9C%AC%E5%8F%AF%E6%89%A7%E8%A1%8C.png)
也许你能帮我解决问题……我正在尝试在 WSL 中的 Ubuntu 18.04 上制作一个可执行的 Python 脚本。我创建了一个文件夹来保存我的 Python 脚本/home/<user>/Python_scripts
。其次,我尝试使用文件链接该文件夹.pythonrc
#.pythonrc file
import sys
import os
sys.path.append('/home/<user>/Python_scripts/')
print ('Scripts loaded')
#end .pythonrc file
第三,我添加.bashrc
下一行以关联.pythonrc
文件:
export PYTHONSTARTUP=$HOME/.pythonrc
最后,source .bashrc
但是脚本从未加载,我找不到可执行脚本。
提前谢谢你。