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)>)

 

posted @ 2014-10-21 11:29  xrange  阅读(2004)  评论(0编辑  收藏  举报