i can’t find who defined the '__path__',why '__path__' can be use.
import os
import sys
import warnings
import ConfigParser # ConfigParser is not a virtualenv module, so we can use it to find the stdlib
dirname = os.path.dirname
distutils_path = os.path.join(os.path.dirname(ConfigParser.__file__), 'distutils')
if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)):
warnings.warn(
"The virtualenv distutils package at %s appears to be in the same location as the system distutils?")
else:
__path__.insert(0, distutils_path)#who defined me.???
exec open(os.path.join(distutils_path, '__init__.py')).read()
You really need to read some Python documentation and learn the basics of the language.
I checked, and you seem to speak Chinese. Here are Python documentation resources in Chinese:
http://www6.uniovi.es/python/doc/NonEnglish.html#chinese
Now, to answer your question. I wasn’t sure what the answer was, so I used Google. I did a Google search for “
Python __path__” and very quickly found:http://docs.python.org/tutorial/modules.html