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
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