0

My file structure like

    Myfolder/
           main/
              -main.py
           folder1/
              -file1.py
           folder2/
              -file2.py

I call file1.py with

sys.path.insert(0, '../file1')
import file1

that work, but i dont know how to do it again for file2.py. please help

Thanawat.ch
  • 25
  • 1
  • 2
  • 7

1 Answers1

0

You can do it in the following way without inserting in the sys path.

import .folder2.file2
import .folder1.file1
Neekoy
  • 2,325
  • 5
  • 29
  • 48