python 在初始化运行环境时所有预加载模块
python 在初始化运行环境时,会预加载一批内建模块到内存。
所有预加载模块如下:
1 >>> for item in sys.modules.items(): 2 ... print item 3 ... 4 (‘copy_reg‘, <module ‘copy_reg‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/copy_reg.pyc‘>) 5 (‘encodings‘, <module ‘encodings‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/encodings/__init__.pyc‘>) 6 (‘site‘, <module ‘site‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/site.pyc‘>) 7 (‘__builtin__‘, <module ‘__builtin__‘ (built-in)>) 8 (‘__main__‘, <module ‘__main__‘ (built-in)>) 9 (‘encodings.encodings‘, None) 10 (‘abc‘, <module ‘abc‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/abc.pyc‘>) 11 (‘posixpath‘, <module ‘posixpath‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/posixpath.pyc‘>) 12 (‘_weakrefset‘, <module ‘_weakrefset‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/_weakrefset.pyc‘>) 13 (‘errno‘, <module ‘errno‘ (built-in)>) 14 (‘encodings.codecs‘, None) 15 (‘_abcoll‘, <module ‘_abcoll‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/_abcoll.pyc‘>) 16 (‘types‘, <module ‘types‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/types.pyc‘>) 17 (‘_codecs‘, <module ‘_codecs‘ (built-in)>) 18 (‘_warnings‘, <module ‘_warnings‘ (built-in)>) 19 (‘genericpath‘, <module ‘genericpath‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/genericpath.pyc‘>) 20 (‘stat‘, <module ‘stat‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/stat.pyc‘>) 21 (‘zipimport‘, <module ‘zipimport‘ (built-in)>) 22 (‘encodings.__builtin__‘, None) 23 (‘warnings‘, <module ‘warnings‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/warnings.pyc‘>) 24 (‘UserDict‘, <module ‘UserDict‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/UserDict.pyc‘>) 25 (‘encodings.utf_8‘, <module ‘encodings.utf_8‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/encodings/utf_8.pyc‘>) 26 (‘sys‘, <module ‘sys‘ (built-in)>) 27 (‘codecs‘, <module ‘codecs‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/codecs.pyc‘>) 28 (‘readline‘, <module ‘readline‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/lib-dynload/readline.so‘>) 29 (‘os.path‘, <module ‘posixpath‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/posixpath.pyc‘>) 30 (‘signal‘, <module ‘signal‘ (built-in)>) 31 (‘linecache‘, <module ‘linecache‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/linecache.pyc‘>) 32 (‘posix‘, <module ‘posix‘ (built-in)>) 33 (‘encodings.aliases‘, <module ‘encodings.aliases‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/encodings/aliases.pyc‘>) 34 (‘exceptions‘, <module ‘exceptions‘ (built-in)>) 35 (‘os‘, <module ‘os‘ from ‘/Users/Kris/git_space/pyv/lib/python2.7/os.pyc‘>) 36 (‘_weakref‘, <module ‘_weakref‘ (built-in)>)
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。