Okay so if I am going to make a Python application that will be distributed to others I need all the file paths to not be absolute, but relative to the root directory (I believe).
Let's say the file system looks something like this:
root
|
| - app.py
| - data
| |
| | - file1.txt
| | - file2.txt
|
| - src
|
| - python_file.py
Of course the file system would be more complex than this. However, let's say I need the python_file.py to grab the file1.txt. How would you do this for an application that cannot use any absolute paths. I assume it is with the os module, I have seen some examples, but many of them are different, and some do not work.
I would love to know how to do this so that all the files can interact together correctly for any system ('dynamically' so to speak).