l.extend does work. Thanks!

On Monday, October 22, 2012, Saad Javed wrote:

> My program downloads multiple entry values from the net. I'm trying to
> combine them in a list in a particular sequence.
>
> l = []
> feed1 = urllib2.urlopen(rssPage1)
> tree1 = etree.parse(feed1)
> x = tree1.xpath("/rss/channel/item/title/text()")
> y = tree1.xpath("/rss/channel/item/pubDate/text()")
> z = tree1.xpath("/rss/channel/item/link/text()")
> for e, f, g in zip(x, y, z):
>  l.append([e, f, g])
> print l
>
> The problem I'm facing is that the values don't combine into a single list
> ("l"). It keeps printing multiple lists with three values e, f, g as the
> xml tree is parsed.
>
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to