1
希望有一种简单的方法来列出Python标准库模块和类子模块吗?列表标准Python库模块化和适当的子模块?
我看过this问题,但它不适合我,不是因为它列出了所有可用的模块(可以调整以避免,我知道),但它不包括子模块。例如像它列出模块的urllib但无子模块类:
urllib.ContentTooShortError urllib.main urllib.splituser
urllib.FancyURLopener urllib.noheaders urllib.splitvalue
urllib.MAXFTPCACHE urllib.os urllib.ssl
urllib.URLopener urllib.pathname2url urllib.string
urllib.addbase urllib.proxy_bypass urllib.sys
urllib.addclosehook urllib.proxy_bypass_environment urllib.test
urllib.addinfo urllib.quote urllib.test1
urllib.addinfourl urllib.quote_plus urllib.thishost
urllib.always_safe urllib.reporthook urllib.time
urllib.basejoin urllib.socket urllib.toBytes
urllib.c urllib.splitattr urllib.unquote
urllib.ftpcache urllib.splithost urllib.unquote_plus
urllib.ftperrors urllib.splitnport urllib.unwrap
urllib.ftpwrapper urllib.splitpasswd urllib.url2pathname
urllib.getproxies urllib.splitport urllib.urlcleanup
urllib.getproxies_environment urllib.splitquery urllib.urlencode
urllib.i urllib.splittag urllib.urlopen
urllib.localhost urllib.splittype urllib.urlretrieve
那么,有一些其他的方式?
http://stackoverflow.com/questions/1707709/list-all-the-modules-that-are-part-of-a-python-package – dierre
所以,你建议我使用我的链接问题列出声压级模块然后使用'pkgutil'打印子模块?如果那样的话,有没有其他方法可以导入整个Python库?谢谢 – theta
你为什么需要这个? –