Why ConfigParser can't write to file?

Jeff Hinrichs jlh at cox.net
Sat Feb 23 12:01:19 EST 2002


fp is a file pointer.
open the file (for write "w") and you are handed a file pointer
pass it to the ConfigParser, it writes to the file pointer
then you close the file.

hth
"Ricky" <store_li at sina.com> wrote in message
news:a58885$5acoc$1 at ID-12869.news.dfncis.de...
> Yes, as you guess, I haven't call .write method, because I was confused by
> the usage of write method. It always required a fp object, which I totally
> don't what it means. Is it a object create by
a=ConfigParser.ConfigParser()
> or a file name or a section name?
>
> Please help me! Thank you!
>
>
> "Graham Ashton" <graz at mindless.com> wrote in message
> news:fUJd8.418$PE2.43612 at stones...
> > On Fri, 22 Feb 2002 16:36:22 +0000, Ricky wrote:
> >
> > > I intend to use ConfigParser module to manage my INI file. I can use
get
> > > to retrieve data from my ini file, and use set to change option value
in
> > > Python, just in python, after I closed python, I found that all
changes
> > > I made in python lost. There is nothing altered in my ini file!
> > >
> > > How can I make my ini file to be changed?
> >
> > As you haven't posted any code I can't be sure, but I suspect from what
> > you've said that you've not called the write() method on your
> > ConfigParser object.
> >
> > Read the module's docs.
> >
> > --
> > Graham
>
>





More information about the Python-list mailing list