0

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 referencing the base module? i dont want to reference myModule, because i am working on a branch so the name is going to change.

alex
  • 2,968
  • 3
  • 23
  • 25
  • 1
    If the name is going to change, why can't you just change it now and get it over with? – David Z Sep 20 '10 at 20:58
  • i have two versions of a module and i want to reference them both untill i merge the branch. – alex Sep 20 '10 at 21:43

1 Answers1

0

You're asking about relative imports. See this question

Within myFile3, you want:

from .. import myFile2
Community
  • 1
  • 1
snapshoe
  • 13,454
  • 1
  • 24
  • 28