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