Importar os proprios pacotes.

#path
Math/
    __init__.py
    divide.py
    minus.py
    multiply.py
    plus.py
#main.py
from plus import *
from minus import *
from multiply import *
from divide import *
#error run
Traceback (most recent call last):
  File "", line 1, in 
    import Math
  File ".\Math\__init__.py", line 1, in 
    from plus import *
ImportError: No module named 'plus'

#main.py solution
from .plus import *
from .minus import *
from .multiply import *
from .divide import *

Comentários