Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the standard config file name and extension in Python?

I'm creating a config file to hold configuration/properties settings for my project that frequently change, such as file paths. What's the standard name/extension for such a file? (e.g. in Java I've used config.xml, in VB.NET I've used App.config...)

like image 732
froadie Avatar asked May 17 '10 14:05

froadie


2 Answers

Ok, I've asked around where I work and researched a little, and this is what I've come up with as suggestions:

  • settings.ini
  • applicationName.config
  • applicationName.cfg

If anyone has any other suggestions, feel free to add...

like image 169
froadie Avatar answered Sep 28 '22 06:09

froadie


First, consider using ConfigParser (configparser in 3.0, so the documentation says). That doesn't solve the naming problem, but it is a readable alternative to xml for most configuration needs.

Whatever name you use, make all the parts meaningful. I would probably use something like appName.cfg, where appName identifies your application, or the part of the application the configuration is for.

like image 27
Pierce Avatar answered Sep 28 '22 04:09

Pierce