0% found this document useful (0 votes)
107 views1 page

Tkinter Example

This is an example of Python using the TKinter interface. It uses a class structure to just to access the tool, with a random list of objects. Enjoy

Uploaded by

CromeXza
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views1 page

Tkinter Example

This is an example of Python using the TKinter interface. It uses a class structure to just to access the tool, with a random list of objects. Enjoy

Uploaded by

CromeXza
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

""" Tkinter Example This is an example of a tkinter test. Accesing various Tools using the TK interface.

The method uses a class as an output. In order to acces the TK interface. 2013-06-01 Untested. """

from Tkinter import * class Application(Frame): def say_hi(self): print "hi there, everyone!" def PrintCal(self): print "The Calculation of 4x4=" def createWidgets(self): self.QUIT = Button(self) self.QUIT["text"] = "QUIT" self.QUIT["fg"] = "red" self.QUIT["command"] = self.quit self.QUIT.pack({"side": "left"}) self.hi_there = Button(self) self.hi_there["text"] = "Hello", self.hi_there["command"] = self.say_hi self.hi_there.pack({"side": "left"}) self.printcal = Button(self) self.printcal["text"] = "My test button" self.printcal["fg"] = "orange" self.printcal["command"] = self.PrintCal self.printcal.pack({"side": "left"}) def __init__(self, master=None): Frame.__init__(self, master) self.pack() self.createWidgets() root = Tk() app = Application(master=root) app.mainloop() root.destroy()

You might also like