#!/usr/bin/env python import ConfigParser import sys ver = "python version " for c in sys.version: ver += c if c==" ": break print ver # make a config parser conf = ConfigParser.ConfigParser() # make a section called `sect' conf.add_section("sect") # in `sect', make an option called `opt' conf.set("sect","opt",2) # print to verify that everything worked conf.write(sys.stdout) # the following lines fail in 2.3 ... conf.get("sect","opt") conf.getint("sect","opt")