can someone explain why ..

Schüle Daniel uval at rz.uni-karlsruhe.de
Tue Apr 25 18:58:40 EDT 2006


I don't understand what is the difference between commented lines
1 and 2

with 1 uncommented and 2 commented it works as expected
with 1 commented and 2 uncommented the picture doesn't appear

here is my code

#!/usr/bin/env python

from Tkinter import *
from Tkconstants import *

root = None

class Main:
     def __init__(self):
             global root
             root = Tk(className = "Zeitrechner")
             root.config(borderwidth = 5, relief = GROOVE)
             root.geometry("0x0+100+50")

             #self.im = image = PhotoImage(file = "./flower1.gif")  #1
             image = PhotoImage(file = "./flower1.gif")             #2
             frame1 = Frame(master = root, borderwidth = 3, relief = SUNKEN)
             imageLabel = Label(master = frame1, image = image)

             root.minsize(width = image.width(), height = image.height())
             root.maxsize(width = 2*image.width(), height = image.height())

             imageLabel.pack()
             frame1.pack(side = LEFT)

     def mainloop(self):
             root.mainloop()

main = Main()
main.mainloop()



More information about the Python-list mailing list