开发者

PYTHONPATH storage location

开发者 https://www.devze.com 2023-01-10 20:28 出处:网络
Where is my pythonpath stored? When I write import sys sys.path Where does Python get that 开发者_开发技巧data?Python gets that data from the path attribute of the sys module. This path is a list,

Where is my pythonpath stored? When I write

import sys
sys.path

Where does Python get that 开发者_开发技巧data?


Python gets that data from the path attribute of the sys module. This path is a list, and if you want to add a new directory to the path, just use the append method.

For instance, to add the directory /home/me/mypy to the path, just do:

import sys
sys.path.append("/home/me/mypy")
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号