阅读背景:

python 查找模块的文件路径

来源:互联网 

有时候想知道import的模块的文件路径,看看脚本,可以通过以下方式来查看:

Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import identmodule
>>> print identmodule.__file__
/usr/lib/python2.6/site-packages/identmodule/__init__.pycPyt



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: