I need this python project to be useable for multiple users after downloading it from git, but I'm having a problem generalizing paths. I have it set to use absolute paths in my version, but that will break for others, and if I'm using a file in the same directory as the module, python can't find it if I use the relative path (i.e., with open('foo.txt') as f
).
I settled on a text file called properties.txt in the project directory, and a module that reads it into a dict. Right now it just has one line, MAIN_DIR=/my/home/directory
. The problem is circular though. I can't use a relative path to read that text file either.
I'm confident this solution is overengineered. There's got to be a way to get around that, or to get around the problem with relative paths in the first place?