py2exe/pyinstaller: Is it bad practice to put all configurable variables in a .py file? [closed]

StackOverflow https://stackoverflow.com/questions/21222632

  •  30-09-2022
  •  | 
  •  

Question

I'm writing a script for a colleague who runs Windows but my development environment is GNU/Linux.

I have a bunch of variables that need to be configurable. So I put them all in a config.py that I've imported it into the main project.

Originally I planned to ask him to install Cygwin but then I thought of packaging it into an exe with py2exe or pyinstaller. I've not used either of these before so I don't know how they work. Would I have problems with the config.py file or should I be using an actual module like ConfigParser to store my settings so that it can be separate from the .exe file?

Was it helpful?

Solution

The problem you would have is that if your friend decided to change something in the config, he'd have to ask you to do it, run py2exe again and send the .exe to him again. With an .ini file, he'd simply edit the file.

OTHER TIPS

I would definitely use a config parser or even just a json or ini file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top