i have a module with many files, which i import in themselves for sharing of functionality
myModule/
-myFile1.py
-myFile2.py
-mySubmodule/
--myFile3.py
i can do import myFile2
, inside of myFile1, but how can i do a import myFile2
in myFile3 without refer开发者_C百科encing the base module? i dont want to reference myModule, because i am working on a branch so the name is going to change.
You're asking about relative imports. See this question
Within myFile3, you want:
from .. import myFile2
精彩评论