Life is short, you need Python

Python中的搜索路径

1. 当前目录

2. 环境变量PYTHONPATH中的目录

3. Python安装目录(for Linux OS:/usr/local/lib/python

When a module named spam is imported, the interpreter search for a file named spam.py in the current directory

and then in list of directoried specified by the enviroment variable PYTHONPATH. This has the same syntax as the shell variable PATH, that is, a list of directory names. When PYTHONPATH is not set, or when the file is not found there, the search continues in an installation-dependent default path; on Unix, this is usually(/usr/local/lib/python)

 

 

posted @ 2010-10-08 13:44  runfox545  阅读(1993)  评论(0编辑  收藏  举报
白月黑羽 Python教程 白月黑羽Python