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("/rs
On Mon, Oct 22, 2012 at 06:44:51AM +0500, 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 = []
[snip rest of code]
> l.append([e, f, g])
> The problem I'm facing is that the values don't combine i
On Sun, Oct 21, 2012 at 9:44 PM, 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
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 = tree
On 21/09/12 03:18, eryksun wrote:
On Thu, Sep 20, 2012 at 12:57 PM, eryksun wrote:
I forgot the obligatory warning about class variables. The subclass
gets a shallow copy of the parent class namespace. The in-place
^^^
>>> Y.data += [1]
>>> X.data # modified p
On Thu, Sep 20, 2012 at 3:39 PM, Steven D'Aprano wrote:
> On 21/09/12 02:57, eryksun wrote:
>>
>> On Thu, Sep 20, 2012 at 12:25 PM, eryksun wrote:
>
> Preferred terminology is attribute, not variable. Class attributes live
> in the class and are shared across all instances. Instance attributes
>
On 21/09/12 02:57, eryksun wrote:
On Thu, Sep 20, 2012 at 12:25 PM, eryksun wrote:
cls._count += 1
I forgot the obligatory warning about class variables.
Python is not Java. In Python, classes are first-class objects (no pun
intended) and can be assigned to variables the same
Ara Kooser wrote:
> Morning,
>
> I dug out some old code from 5 years ago to clean up and get in working
> order. It's a simple agent based model. I have class called Ant which
> contains all the ant-like functions.
>
> I have a list that tracks the ants but I did this is a very crude way. I
>
On Thu, Sep 20, 2012 at 12:57 PM, eryksun wrote:
>
> I forgot the obligatory warning about class variables. The subclass
> gets a shallow copy of the parent class namespace. The in-place
^^^
> >>> Y.data += [1]
> >>> X.data # modified parent, too
> [1]
> >>> Y.da
On Thu, Sep 20, 2012 at 12:25 PM, eryksun wrote:
>
> cls._count += 1
I forgot the obligatory warning about class variables. The subclass
gets a shallow copy of the parent class namespace. The in-place
addition above works because numbers are immutable. However, an
in-place operation o
On Thu, Sep 20, 2012 at 10:41 AM, Ara Kooser wrote:
>
> I have a list that tracks the ants but I did this is a very crude way. I
> basically copied and pasted everything in there like this:
>
> ants =
> [Ant("Red_1","Red","yellow_food"),Ant("Yellow_1","Yellow","red_food"),
> Ant("Red_2","Red","yel
Oscar,
Thanks for that. I feel a bit silly. I forgot about the % which was
hanging me up. I am trying to be a better coder. More work ahead for me!
ara
On Thu, Sep 20, 2012 at 9:01 AM, Oscar Benjamin
wrote:
> On 20 September 2012 15:41, Ara Kooser wrote:
>
>> Morning,
>>
>> I dug out some
On 20 September 2012 15:41, Ara Kooser wrote:
> Morning,
>
> I dug out some old code from 5 years ago to clean up and get in working
> order. It's a simple agent based model. I have class called Ant which
> contains all the ant-like functions.
>
> I have a list that tracks the ants but I did th
On 9/20/2012 7:41 AM Ara Kooser said...
Morning,
I dug out some old code from 5 years ago to clean up and get in
working order. It's a simple agent based model. I have class called Ant
which contains all the ant-like functions.
I have a list that tracks the ants but I did this is a very crud
Morning,
I dug out some old code from 5 years ago to clean up and get in working
order. It's a simple agent based model. I have class called Ant which
contains all the ant-like functions.
I have a list that tracks the ants but I did this is a very crude way. I
basically copied and pasted everyt
15 matches
Mail list logo