I have made a package in the following structure:
test.py
pakcage1/
__init__.py
module1.py
module2.py
In the test.py
file, with the code
from package1 import *
what I want it to do is to
from numpy import *
from module1 import *
from module2 import *
What should I write in __init__.py
file to achieve this?
Currently in my __init__.py
file I have
from numpy import *
__all__ = ['module1',module2']
and this doesn't give me what I wanted. In this way numpy wan't imported at all, and the modules are imported as
import module1
rather than
from module1 import *
from package1 import *
behave likefrom numpy import *
would be of any good. – btoueg 4 mins ago