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?

Était-ce utile?

La 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.

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top