I have such a project structure
--- Package1/code.py --- paccage2/ext.py how to import me variable from Ext.PY to Code.Py?
from ext import var - it does not work, says that there is no module Ext
question@mail.ru
·
01.01.1970 03:00
I have such a project structure
--- Package1/code.py --- paccage2/ext.py how to import me variable from Ext.PY to Code.Py?
from ext import var - it does not work, says that there is no module Ext
answer@mail.ru
·
01.01.1970 03:00
Everything works.
in the files indicate from without leading points:
from package2.Ext import var from ..package2.ext import var
you need to call from the folder of your_project here is the following command:
pre>Python -m package1.code
You can indicate the path to python completely, type usr/bin/python . It is important to indicate -m and the point . .py
So:
Way_K_VAMICUMT & GT; python -m package1.code PREA>