Python Forum

Full Version: python How to import All modules from namespace
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i tried to import all modules of namespaces but no modules imported.  how can I import all ?

example
# myfolder
#  | mymodule1.py
#  | mymodule2.py
#  | mymodule3.py
#  | subfolder

import myfolder # imports namespace
from myfolder import * # imports nothing. why ?
you need to read about packages
https://docs.python.org/3.6/tutorial/mod...l#packages

also what you are doing - import myforlder (what you call import of namespace) and then from my folder import * expecting to import something from imported namespace - it doesn't make sense.