简体   繁体   中英

List standard Python library moduled and appropriate submodules?

Is there, hopefully, an easy way to list Python standard library modules and class submodules?

I read this question but it's not working for me, not because it lists all available modules (can be tweaked to avoid, I know) but it does not include submodules. Like for example it lists module urllib but without submodule classes:

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

So is there some other way?

To drill into submodules use the inspect and pyclbr modules. Those are the same support tools used by pydoc, help, and sphinx.

Good luck with your tooltip maker.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM