I know there are similar questions asked but what I found is not very clear to me in this simple setting. Given this directory tree how can I import a function from file1.py into file2 (we call the interpreter from the file2.py)? I would like this setting to work independently on where main_folder is, that is if I copy main_folder to a different directory, the imports would still work well.
main_folder
folder1
file1.py (with a function func())
folder2
file2.py