Tutorial by Examples

In config.ini: [DEFAULT] debug = True name = Test password = password [FILES] path = /path/to/file In Python: from ConfigParser import ConfigParser config = ConfigParser() #Load configuration file config.read("config.ini") # Access the key "debug" in "DEF...
Configuration file contains sections, each section contains keys and values. configparser module can be used to read and write config files. Creating the configuration file:- import configparser config = configparser.ConfigParser() config['settings']={'resolution':'320x240', ...

Page 1 of 1