Joh*_*hin 11
sys.modules.values()...如果你真的需要模块的名称,请使用sys.modules.keys()
dir() 不是你想要的.
>>> import re
>>> def foo():
... import csv
... fubar = 0
... print dir()
...
>>> foo()
['csv', 'fubar'] # 're' is not in the current scope
>>>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
733 次 |
| 最近记录: |