All,
File structure:
\
util
utils.py
modules
__init__.py
modules1.py
submodule
__init__.py
submodule.py
I want to know how to import utils.py
in those
__init__.py
for example, now I run the python interpreter in \ level, I run import modules
, I suppose the code from ..util.utils import *
may works, but it is not.
may I know where is the mistake? and may I know if there's a way i can import utils.py in a universal format? something like
import \util\utils.py
I know I may use path.append(), but any alternative?
Thanks
============
got the answer from this post: