Предположим, следующая структура:
- /src/definitions.py
- /src/class.py
- main.py
Код: Выделить всё
definitions.pyв class.py Я импортирую:
Код: Выделить всё
from . definitions import A, B, C
1)
Код: Выделить всё
from src.class import MyClass
from src.definitions import A, B, C, D, E
2)
Код: Выделить всё
from src.class import MyClass, A, B, C
from src.definitions import D, E
Мобильная версия