This may be well written somewhere on the internet (even on SO) but I could not find it.
Suppose I have a Python project structure like the following
mymodule
|—-__init__.py
|—-a.py
|—-b.py
|—-c.py
main.py
Now, I want to import in main.py
everything from mymodule
, meaning I want to be able to do the following:
import mymodule
mymodule.a.something()
mymodule.b.something_else()
I do not want to do the following:
import mymodule.a
import mymodule.b
import mymodule.c
How can I achieve this? In JS ES6, you would create a file mymodule.js
for example, in which you would import everything that you want to export, and then export it. Is there something similar possible in Python?