[英]Adding PYTHONPATH to .zprofile/.bash_profile
I need to add the contents of a directory called Python with many folders in it containing python scripts to my PYTHONPATH in zsh to allow them to be imported.我需要将名为 Python 的目录的内容添加到我在 zsh 中的 PYTHONPATH 中,其中包含许多包含 python 脚本的文件夹,以允许导入它们。 So far I am planning on using a for loop to iterate through the directories and add the script paths to the PYTHONPATH like so:到目前为止,我计划使用 for 循环遍历目录并将脚本路径添加到 PYTHONPATH,如下所示:
for dir in /Users/will/Python/*
do做
... ...
done完毕
if [ -f ~/.zprofile ];如果 [ -f ~/.zprofile ]; then source ~/.zprofile fi然后来源 ~/.zprofile fi
Im not sure what to do next or if this is in any way correct and any help is appreciated.我不确定下一步该做什么,或者这是否正确,并且感谢任何帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.