list of Canvases contais only Nones

Meinrad Recheis meinrad.recheis at aon.at
Mon Jan 27 15:50:33 EST 2003


hello,

i am creating a frame with a lot of small canvases on it ant want to
store the references in a list, but i get a list of nones instead.
the frame gets created and shows all the canvases! so they are 
definitely somewhere.

whats wrong with my code?

#my try:

canv_list = []
root = Tkinter.Tk()
for j in range(0,y_nr):
     for i in range(0,x_nr):
         canv_list.append(Tkinter.Canvas(root,
                                         width = x_size,
                                         height = y_size,
                                         background = 'white',
                                         border = 0
                                         ).grid(row=j,column=i)
                          )
print canv_list

# the output of this code:

[None, None, None, None, None, None]

Thanks for help, Meinrad Recheis





More information about the Python-list mailing list