This is similar to Where to put a configuration file in Python?, but I\'m asking about scripts compiled/frozen with py2exe or similar on Windows systems. (Namely, this one: Wha
I've created "compiled" executables in python on widnows that have files types associated with it, and I never had any issues opening my config file which was placed in the same location as the .exe. I used something like this to find it:
conf = open(r"%s\settings.conf" % os.getcwd())
I stored my values separated by a newline character, so the file looked like this:
PNelson
21
6'
This stores a username, age, and height, to read the values I would use something like this:
settings = "\n".split(conf.read())
I'd then check the length of the array to make sure the config file wasn't corrupted or some way, if it was I'd write default values to the file and use those.