Re: Python newbie with a problem writing files

2006-09-04 Thread limodou
On 4 Sep 2006 08:16:24 -0700, Jason <[EMAIL PROTECTED]> wrote: > limodou wrote: > > > Code: > > > > > > import feedparser > > > from xml.sax import saxutils > > > > > > feed_number=200 > > > > > > feed_list = open("feed_listing.conf","r") > > > for each_feed in feed_list: > > > data=feedparser.

Re: Python newbie with a problem writing files

2006-09-04 Thread Damjan
> Code: > xml_output.write = (feed_title) How did you come up with that "=" there??! The correct line is: xml_output.write(feed_title) > Traceback (most recent call last): > File "C:/My_Blogroll/JJ_Blogroll2", line 11, in ? > xml_output.write = (feed_title) > AttributeError: '

Re: Python newbie with a problem writing files

2006-09-04 Thread Jason
limodou wrote: > > Code: > > > > import feedparser > > from xml.sax import saxutils > > > > feed_number=200 > > > > feed_list = open("feed_listing.conf","r") > > for each_feed in feed_list: > > data=feedparser.parse(each_feed) > > feed_title=data.entries[0].title > > xml_output=open("xm

Re: Python newbie with a problem writing files

2006-09-03 Thread John Machin
Mike Kent wrote: > > feed_list = open("feed_listing.conf","r") > > What could it be about the above line that means "Open this file for > READ ONLY"? That's his *INPUT* file. The error referred to his *OUTPUT* file, and in any case the complain was that the "write" attribute was read-only, *NOT* t

Re: Python newbie with a problem writing files

2006-09-03 Thread Tim Chase
>> feed_list = open("feed_listing.conf","r") > > What could it be about the above line that means "Open this file for > READ ONLY"? Oooh, oooh, I know! If you rot13 the file-name, it comes back as "srrq_yvfgvat.pbas". The double "r"s in the file-name instruct python to open the file as "reall

Re: Python newbie with a problem writing files

2006-09-03 Thread Mike Kent
> feed_list = open("feed_listing.conf","r") What could it be about the above line that means "Open this file for READ ONLY"? -- http://mail.python.org/mailman/listinfo/python-list

Python newbie with a problem writing files

2006-09-03 Thread John J. Jones
Doh!!! You are right. It was staring me in the face. I shouldn’t have that ‘=’ sign at all!! I removed it and it works!! Now I just have to put in a routine to remove non-ascii characters from the data before writing it and all will be golden.    Thanks JJ -- http://mail.pyth

Re: Python newbie with a problem writing files

2006-09-03 Thread limodou
On 9/4/06, John Jones <[EMAIL PROTECTED]> wrote: > Hi All, > > I have been driven insane by this error. I have this small program, shown > below, which runs great until it gets to writing the data out to the file. I > am running an install of Python 2.4. Yes, feedparser is functioning fine (I

Python newbie with a problem writing files

2006-09-03 Thread John Jones
Hi All, I have been driven insane by this error. I have this small program, shown below, which runs great until it gets to writing the data out to the file. I am running an install of Python 2.4. Yes, feedparser is functioning fine (I put in print feed_title statements as tests - but have s