David wrote:
> Martin Walsh wrote:
>
>> Welcome!
>
> thanks
welcome (uh oh, infinite loop warning)
> This "podcast_file.write('%s: %s' % (entry.updated, entry.link))"
> writes it in one very long string
Copy and paste gets me every time. Try this, and note the presence of
the newline ('\n'):
"David" wrote
sys.stdout = open("podcast_links.txt", "a")
print '%s' % (entry.link)
sys.stdout.close()
getFeed()
This "podcast_file.write('%s: %s' % (entry.updated, entry.link))"
writes it in one very long string
Use podcastfile.writeline() to write it line by line
Martin Walsh wrote:
Welcome!
thanks
You should probably try to avoid reassigning sys.stdout. This is usually
a bad idea, and can cause odd behavior that is difficult to
troubleshoot, especially for a beginner. A reasonable approach is to
assign the open file object to a name of your own ch
Hi David,
David wrote:
> Hi everyone.
> Just learning :) I have one program to parse a podcast feed and put it
> into a file.
Welcome!
>
> def getFeed():
> url = raw_input("Please enter the feed: ")
> data = feedparser.parse(url)
> for entry in data.entries:
> sys.stdout =
On Sun, Dec 21, 2008 at 7:29 PM, David wrote:
> This seems to work;
>
> download = L.readline()
> print download
> download = download[0:-1]
>
> What is that last character that is added;
> .mp3%0A
It is a newline character (line feed). readline() includes the line
endings in the returned lines.
This seems to work;
download = L.readline()
print download
download = download[0:-1]
What is that last character that is added;
.mp3%0A
--
Powered by Gentoo GNU/LINUX
http://www.linuxcrazy.com
pgp.mit.edu
___
Tutor maillist - Tutor@python.org
http
Hi everyone.
Just learning :) I have one program to parse a podcast feed and put it
into a file.
#!/usr/bin/python
"""Get feed date and link details"""
import feedparser
import sys
def getFeed():
url = raw_input("Please enter the feed: ")
data = feedparser.parse(url)
for entry in d