下面是测试过程:
In [7]: import sys
In [8]: os
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/home/jessinio/data/workspace/project/<ipython console> in <module>()
NameError: name 'os' is not defined
In [9]: sys.getrefcount( sys.modules['os'] )
Out[9]: 58
In [10]: import os
In [11]: sys.getrefcount( sys.modules['os'] )
Out[11]: 59
In [12]: id( sys.modules['os'] )
Out[12]: 3078271308L
In [13]: id( os )
Out[13]: 3078271308L
切记: 数据要比编程逻辑更容易驾驭(The Art of Unix Programming )
Thursday, January 7, 2010
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment