Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
importing an attribute
#6
snippsat Wrote:Can say the last version is more user friendly,if try to figure out a package without looking at doc.
You can use pkgutil for this, the following code should work
import pkgutil
import botocore
print([t[1] for t in pkgutil.iter_modules(botocore.__path__)])
Actually, I already wrote a script for this task in this forum list_subpackages.py
With this you only need to call on the commandline
Output:
list_subpackages.py botocore
It also lists subsubpackages recursively.
Reply


Messages In This Thread
importing an attribute - by Skaperen - Apr-14-2019, 03:06 AM
RE: importing an attribute - by woooee - Apr-14-2019, 05:13 AM
RE: importing an attribute - by Skaperen - Apr-14-2019, 05:48 AM
RE: importing an attribute - by Gribouillis - Apr-14-2019, 06:32 AM
RE: importing an attribute - by snippsat - Apr-14-2019, 08:17 AM
RE: importing an attribute - by Gribouillis - Apr-14-2019, 10:48 AM
RE: importing an attribute - by Skaperen - Apr-14-2019, 01:55 PM
RE: importing an attribute - by snippsat - Apr-14-2019, 03:54 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020