Re: how to write special value to a config file with ConfigParser

2006-04-23 Thread pavel . starek
Hi, I have tried this: import ConfigParser fp = file("test.conf","w+") cp = ConfigParser.ConfigParser() cp.add_section("Section1") cp.set("Section1","Value1",12345) cp.write(fp) and works fine for me. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write special value to a config file with ConfigParser

2006-04-23 Thread Lialie
Lialie write: OK.I find out myself. Excuse me. Just open ini file in write mode. --- Begin Message --- Lialie write: OK.I find out myself. Excuse me. Just open ini file in write mode. --- End Message --- -- http://mail.python.org/mailman/listinfo/python-list

how to write special value to a config file with ConfigParser

2006-04-23 Thread Lialie
Hello,all I found it easy to read configures from a config file. But how can I set a special value to an item or write it into the original file? I have tried this: import ConfigParser config = ConfigParser.ConfigParser() config.read('a.conf') config.get('Main', 'Something') # That is OK. conf