i'm trying to open a file by calling a function in a diffrent folder.
---Folder1
------reader.py
------data.txt
---Folder2
------main.py
(didn't know how to visualize it better)
In reader i try to set the path with
os.path.abspath("./data.txt")
which works only as long as i run the code within Folder1.
When i try to open "data.txt" by calling the function through "main.py" the path it tries to take is ".../Folder2/data.txt".
Now I know that i can just set the path in "main.py" and add it as a parameter, but since I am going to call the "reader.py" from more than one source, this, while possible, isn't optimal. I hope some of you might have a solution, Ignitz