Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

configuration filename convention

Is there a general naming conventions for configuration files for a simple python program?

Thanks,

Udi

like image 251
Adam Matan Avatar asked Dec 17 '22 06:12

Adam Matan


2 Answers

.conf is a nice extension too. But since mostly configuration files are application specific, it does not really matter what extension they have as long as they are consistent (i.e do not use .conf with .cfg in the same application).

like image 123
erelender Avatar answered Dec 30 '22 18:12

erelender


I am not sure if you mean the file basename, of if your question also includes where to put the configuration file. Anyway, on location:

If it is a linux application, you should follow the XDG Base Directory specification (XDG -> Cross-desktop).

It says you should put your configuration files inside a folder named after your program, in $XDG_CONFIG_HOME/programname/ . XDG_CONFIG_HOME is normally ~/.config

like image 23
u0b34a0f6ae Avatar answered Dec 30 '22 17:12

u0b34a0f6ae