Hi all,

I just start to use ConfigParser to store the configuration for my 
application.
I surfed the mails related to ConfigParser, however I couldn't found the way 
of how to set value back to the .conf file.

Let say, I have a test.conf file with:
[General]
userName="da"

later on, I wanna add another option:
email="[EMAIL PROTECTED]"

I did the following:
import ConfigParser
conf = ConfigParser.ConfigParser()
conf.read('test.conf')

conf.set('General', 'email', '[EMAIL PROTECTED]'

print conf.items('General')
[('username','da'),('email','[EMAIL PROTECTED]')]

But when I look into the file test.conf directly, I didn't see the option 
'email' . I don't know what I am missing here?

Or i need to write it to the file using conf.write(fp)?
If so, how can I get this file pointer?

Thanks very much for your input.

da
-- 
Ms.Kakada Hok
Open Source Engineer
KhmerOS project
Open Institute Organization
H/P:(+855-12) 653 155

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to