Tkinter

Jay first180 at gmail.com
Sun Apr 16 12:33:15 EDT 2006


I still dont quite get it, is their sum kind of way you can [def Newdef
+ i()] for example so that the def is different from the string, all
the buttons now have numbers on

If I am not mistaken Fredrik Lundh rote the tutorial Learning to
program (Python) www.freenetpages.co.uk/hp/alan.gauld/   and
www.effbot.org

If this is the same person then thank you for everything I no about
python it seams what ever I try and learn about Python it is always you
who helps or has wrote docs to help Newbie's and well everyone
really.

---code---
 from Tkinter import *

class App:
    def __init__(self, root):

        self.DisplayAreaListsFrame = Frame(root)
        self.DisplayAreaListsFrame.pack()

        Lists = ["A1","B2","C3","D4"]
        for i in Lists:
            def i():
                print i
            self.DisplayAreaListButton = Button(
                self.DisplayAreaListsFrame,
                text=i,
                command=i)
            self.DisplayAreaListButton.pack(side=LEFT,padx=10)



root = Tk()
app = App(root)
root.mainloop()




More information about the Python-list mailing list