[Level 2] How to know python module come from.

python> print sys.modules
{'copy_reg': <module 'copy_reg' from '/usr/lib/python2.6/copy_reg.pyc'>, 'encodings': <module 'encodings' from '/usr/lib/python2.6/encodings/__init__.pyc'>, 'site': <module 'site' from '/usr/lib/python2.6/site.pyc'>, '__builtin__': <module '__builtin__' (built-in)>, '__main__': <module '__main__' (built-in)>, 'encodings.encodings': None, 'abc': <module 'abc' from '/usr/lib/python2.6/abc.pyc'>, 'posixpath': <module 'posixpath' from '/usr/lib/python2.6/posixpath.pyc'>, 'errno': <module 'errno' (built-in)>, 'encodings.codecs': None, '_abcoll': <module '_abcoll' from '/usr/lib/python2.6/_abcoll.pyc'>, 'types': <module 'types' from '/usr/lib/python2.6/types.pyc'>, '_codecs': <module '_codecs' (built-in)>, '_warnings': <module '_warnings' (built-in)>, 'genericpath': <module 'genericpath' from '/usr/lib/python2.6/genericpath.pyc'>, 'stat': <module 'stat' from '/usr/lib/python2.6/stat.pyc'>, 'zipimport': <module 'zipimport' (built-in)>, 'encodings.__builtin__': None, 'warnings': <module 'warnings' from '/usr/lib/python2.6/warnings.pyc'>, 'UserDict': <module 'UserDict' from '/usr/lib/python2.6/UserDict.pyc'>, 'encodings.ascii': <module 'encodings.ascii' from '/usr/lib/python2.6/encodings/ascii.pyc'>, 'sys': <module 'sys' (built-in)>, 'codecs': <module 'codecs' from '/usr/lib/python2.6/codecs.pyc'>, 'readline': <module 'readline' from '/usr/lib/python2.6/lib-dynload/readline.so'>, 'os.path': <module 'posixpath' from '/usr/lib/python2.6/posixpath.pyc'>, 'signal': <module 'signal' (built-in)>, 'linecache': <module 'linecache' from '/usr/lib/python2.6/linecache.pyc'>, 'posix': <module 'posix' (built-in)>, 'encodings.aliases': <module 'encodings.aliases' from '/usr/lib/python2.6/encodings/aliases.pyc'>, 'crypt': <module 'crypt' (built-in)>, 'exceptions': <module 'exceptions' (built-in)>, 'os': <module 'os' from '/usr/lib/python2.6/os.pyc'>}
Wish this helps.

regards,
Stanley Huang

Comments

Popular posts from this blog

[Level 2] Shell Interactive With Zenity Episode 5 -- list

[Level 2] iif in Python