How to save application settings in a config file?

Domagoj picture Domagoj · Apr 13, 2013 · Viewed 7.4k times · Source

I am developing a program that has a settings window in which I can change various parameters for my program. What is the best way to read/save them in some kind of config file? I know that some software and games use .ini files or similar system. How can I achieve this in Python?

Answer

Cairnarvon picture Cairnarvon · Apr 13, 2013

The Python standard library includes the ConfigParser module, which handles ini-style configuration files for you. It's more than adequate for most uses.