- 论坛徽章:
- 0
|
回复 7# 106033177
关于第一个问题,你可能没看清楚。在例子中时sys没有了,这个包在函数c中是可以调用的。
你对第二个问题的解答,我试了一下,是不是结果太多了,不知我们想要的结果:
>>> print sys.modules.keys()
['json.decoder', 'copy_reg', 'sre_compile', '_sre', 'encodings', 'site', '__buil
tin__', '__main__', 'encodings.encodings', 'json.math', 'json.sre_constants', 'j
son.sre_compile', 'abc', 'posixpath', 'errno', '_json', 'encodings.codecs', 'sre
_constants', 're', 'json', '_abcoll', 'types', '_codecs', '_warnings', 'math', '
json._json', 'genericpath', 'stat', 'zipimport', 'encodings.__builtin__', 'warni
ngs', 'UserDict', 'json.json', 'encodings.utf_8', 'json.sys', 'sys', 'json.scann
er', 'codecs', 'json.encoder', 'readline', 'os.path', 'json.re', 'signal', 'line
cache', 'json.sre_parse', 'posix', 'encodings.aliases', 'exceptions', 'sre_parse
', 'os']
|
|