Hi all,
I have a simple question about "Intra-package References"
There are two source files and __init__.py in package MyPkg shown below:
|-MyPkg
-__init__.py
-example.py
-test.py
example.py is like this:
and test.py is like this:
While I executed test.py, python said "ValueError : Attempted relative import in non-package". Could anybody tell me what's wrong with the code. Thanks!
I have a simple question about "Intra-package References"
There are two source files and __init__.py in package MyPkg shown below:
|-MyPkg
-__init__.py
-example.py
-test.py
example.py is like this:
Code:
a = 5
Code:
from . import example print example.a
Comment