You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# a) absolute import from Package (prefered!)fromPackage.SubPackageimportSubModule# b) relative import from current submodulefrom ..SubPackageimportSubModule
Run main.py
initialized: SimpleModule
initialized: Package
initialized: Package.Module
initialized: Package.SubPackage
initialized: Package.SubPackage.SubModule
initialized: Package.AnotherSubPackage
initialized: Package.AnotherSubPackage.AnotherSubModule
1. module next to script
simplefunction()
simplefunction()
2. module from package
moduleMethod()
moduleMethod()
moduleMethod()
3. module from subpackage
subModuleMethod()
subModuleMethod()
subModuleMethod()
subModuleMethod()
4. intrapackage reference in submodule
anotherSubModuleMethod()
subModuleMethod()