operating system services readfp(fp [filename]reads configuration options from file-like object that has already been opened in fp filename specifies the filename associated with fp (if anyby defaultthe filename is taken from fp name or is set to 'if no such attribute is defined remove_option(sectionoptionremoves option from section section remove_section(sectionremoves section section sections(returns list of all section names set(sectionoptionvaluesets configuration option option to value in section section value should be string write(filewrites all of the currently held configuration data to file file is file-like object that has already been opened example the configparser module is often overlookedbut it is an extremely useful tool for controlling programs that have an extremely complicated user configuration or runtime environment for exampleif you're writing component that has to run inside of large frameworka configuration file is often an elegant way to supply runtime parameters similarlya configuration file may be more elegant approach than having program read large numbers of command-line options using the optparse module there are also subtlebut importantdifferences between using configuration files and simply reading configuration data from python source script the following few examples illustrate some of the more interesting features of the configparser module firstconsider sample ini fileappconfig ini configuration file for my mondo application [outputlogfile=%(logdir) /app log logging=on logdir=%(basedir) /logs [inputinfile=%(indir) /initial dat indir=%(basedir) /input lib fl ff