What's the best way to represent a matrix M with 4 dimensions, such as
M[x][y][z][t] where each element in the sparse matrix could be a simple number,
or could be an executable Python function snipped that returns a value when
that cell is evaluated?
The user of the program will type in Python
I'm trying to update an Entry's textvariable several times within my Button
handler, like so:
from Tkinter import *
from time import *
def my_update():
for i in range(3):
tv.set("Now it's %d"%i)
sleep(1)
root=Tk()
tv=StringVar()
Entry(textvariable=tv).pack()
tv.set("Initial Value o
On Tue, 6 Sep 2005, Danny Yoo wrote:
>> No, that's not what he wants.
>>
>> He wants c = a + b to work when a and b are dictionaries.
>>
>> Why is Python broken in such an obvious way?
> It might not be obvious. If a and b overlap so that they share keys, then
> we might have the following situ
>Is this what you want ?
>
>c = dict(a)
>c.update(b)
>
>Pierre
>> Is there an easy way to combine dictionaries?
>>
>> a = {}
>> b = {}
>>
>> a = {'a':'a', 'b':'b', 'c':'c'}
>> b = {'1':1, '2':2, '3':3}
>> c = a + b # doesn't seem to work
>>
>> desired:
>> c = {'a':'a', 'b':'b', 'c':'c', '1':1,
Why does Python not have a "case" statement, like C?
Thanks! -Mike
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor