[英]How do I add the path to a directory to the environment variables using python
I want to know if it is possible to add the path to a directory to the environment variables permanently using python. 我想知道是否可以使用python将目录的路径永久添加到环境变量中。 I have seen other questions that relate to mine but the answers there only add the path temporarily,I want to know if there's a way to add it permanently
我看过其他与我有关的问题,但那里的答案只是暂时添加路径,我想知道是否有永久添加路径的方法
While using bash add this ~/.bashrc
export PYTHONPATH="${PYTHONPATH}:/Home/dev/path
在使用bash的同时,添加
~/.bashrc
export PYTHONPATH="${PYTHONPATH}:/Home/dev/path
Make sure the directory you point to has at the topmost init.py
file in your directory structure 确保指向的目录在目录结构中位于最顶层的
init.py
文件中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.