【发布时间】:2013-06-28 19:07:11
【问题描述】:
基于http://docs.python.org/release/1.5.1p1/tut/searchPath.html
搜索路径(sys.path)
A list of strings that specifies the search path for modules. Initialized from the environment variable PYTHONPATH, plus an installation-dependent default.
它是在 import 语句中搜索 modules 的路径。
我想知道哪个路径用于搜索数据文件(*txt 文件等)。例如。如果我做一个 fs.open(someFile),python 会搜索哪些路径?
是 sys.path 本身还是?
我的困惑是文档说 sys.path 是 modules 的搜索路径,而数据文件是 not modules。
【问题讨论】:
标签: python