File: walkmodules.py

package info (click to toggle)
impacket 0.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,264 kB
  • sloc: python: 137,329; makefile: 10; sh: 3
file content (15 lines) | stat: -rwxr-xr-x 564 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python
# From https://stackoverflow.com/questions/1707709/list-all-the-modules-that-are-part-of-a-python-package
import pkgutil
import impacket
package=impacket
for importer, modname, ispkg in pkgutil.walk_packages(path=package.__path__,
                                                      prefix=package.__name__+'.',
                                                      onerror=lambda x: None):
    try:
        __import__(modname)
    except Exception as e:
        import traceback
        traceback.print_exc()
        print(e)
        pass