Re: error in ConfigParser

2006-06-28 Thread Steve Holden
pipehappy wrote: > Hello everyone: > > I came across the module ConfigParser and can use it correctly. > > import ConfigParser > fp = open('test.cfg','w+') > config = ConfigParser.ConfigParser() > config.readfp(fp) > config.add_section('test') > config.set('test', 'haha', 'hehe') > print config.s

error in ConfigParser

2006-06-27 Thread pipehappy
Hello everyone: I came across the module ConfigParser and can use it correctly. import ConfigParser fp = open('test.cfg','w+') config = ConfigParser.ConfigParser() config.readfp(fp) config.add_section('test') config.set('test', 'haha', 'hehe') print config.sections() config.write(fp) ['test'] Tr