Feb-07-2020, 11:26 PM
example
will be the package_name
at top level,so you most import from example
.Let say
b.py
is:def foo(): return 42Import test.
E:\div_code λ ptpython >>> import example.test.a.b >>> example.test.a.b.foo() 42 >>> # Using from >>> from example.test.a import b >>> b.foo() 42For this to work most
example
folder with sub-folder be in sys.path
of Python version used eg i use Python 3.7 here.