查找要导入的python模块 [英] Find which python modules are being imported
本文介绍了查找要导入的python模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
从应用程序中使用的特定包中查找所有python模块的简便方法是什么?
What's an easy way of finding all the python modules from a particular package that are being used in an application?
推荐答案
sys.modules
是将模块名称映射到模块的字典.您可以检查其键以查看导入的模块.
sys.modules
is a dictionary mapping module names to modules. You can examine its keys to see imported modules.
请参阅: http://docs.python.org/library/sys .html#sys.modules
这篇关于查找要导入的python模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文