Notice the import statements refer to '''add.py''' by its full 'absolute import' name of '''test.add'''. The test. in front of add is the package name, i.e. the name of the package directory. You can't run a command like "'''from add import add'''" in the __init__.py since Python would get confused if it should load an add.py from inside the module or from elsewhere. Using the full name '''test.add''' tells Python to use the '''add.py''' module inside the '''test''' package directory. | Notice the import statements refer to '''add.py''' by its full 'absolute import' name of '''test.add'''. The test. in front of add is the package name, i.e. the name of the package directory. You can't run a command like "'''from add import add'''" in the __init__.py since Python would get confused if it should load an add.py from inside the module or from elsewhere. Using the full name '''test.add''' tells Python to use the '''add.py''' module inside the '''test''' package directory. |