Answers for "how to import a all the modules in a packege python"

0

how to import a all the modules in a packege python

from os.path import dirname, basename, isfile, join
import glob
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
Posted by: Guest on September-10-2021

Code answers related to "how to import a all the modules in a packege python"

Python Answers by Framework

Browse Popular Code Answers by Language