On Sat, 23 Jul 2005 17:03:08 +0200, Jan Danielsson wrote:
> The problem is that I have initialized the list like this:
>
> self.drawAttr = { blah, blah, blah.. }
> self.storedAttr = [ ]
> for i in range(0, 10):
>self.storedAttr.append(self.drawAttr)
>
>I know what the problem is; they ar
* Kay Schluehr wrote:
> you might initialize self.storedAttr with empty dicts and fill them
> later:
>
> self.soredAttr = [{}]*10
> for entry in self.storedAttr:
> entry.update(self.drawAttr)
As a matter of fact, you're doing the same ;-)
In [1]: x = [{}] * 10
In [2]: x[0]['a'] = 1
In [3]
Jan Danielsson wrote:
> Hello all,
>
>I have written a simple whiteboard application. In my application, I
> want to be able to set draw attributes. This part works. I have a
> dictionary object which contains stuff like:
> self.attr['Pen.Color'] = ...
> self.attr['Pen.Thickness'] = ...
>
>
<[EMAIL PROTECTED]> wrote:
> Jan Danielsson wrote:
> > Hello all,
> >
> >I have written a simple whiteboard application. In my application, I
> > want to be able to set draw attributes. This part works. I have a
> > dictionary object which contains stuff like:
> > self.attr['Pen.Color'] = ...
Jan Danielsson wrote:
> Hello all,
>
>I have written a simple whiteboard application. In my application, I
> want to be able to set draw attributes. This part works. I have a
> dictionary object which contains stuff like:
> self.attr['Pen.Color'] = ...
> self.attr['Pen.Thickness'] = ...
>
>
Hello all,
I have written a simple whiteboard application. In my application, I
want to be able to set draw attributes. This part works. I have a
dictionary object which contains stuff like:
self.attr['Pen.Color'] = ...
self.attr['Pen.Thickness'] = ...
Now, the problem is that I want to be