https://pulumi.com logo
#python
Title
e

elegant-smartphone-60282

08/30/2022, 8:24 AM
Hey, i have this directory tree
Copy code
parent_dir:
  file_1.py
  folder_1:
    folder_2:
      file_2.py
i want to import file_1 to file_2, how to do that?
h

hallowed-animal-47023

09/06/2022, 7:50 PM
You might want to have everything setup as a module and you should be able to do an import
Then you would need to do something like:
Copy code
import sys
sys.path.append('../../parent_dir')
from parent_dir.file_1.py import function
2 Views