-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassignment_tkinter.py
47 lines (32 loc) · 1.13 KB
/
assignment_tkinter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import tkinter
class Application(tkinter.Frame):
def __init__(self,master):
tkinter.Frame.__init__(self,master)
self.pack()
self.morningbutton=tkinter.Button()
self.morningbutton["text"]="Morning"
self.morningbutton["command"]=self.morning
self.morningbutton.pack()
self.afternoonbutton=tkinter.Button()
self.afternoonbutton["text"]="Afternoon"
self.afternoonbutton["command"]=self.afternoon
self.afternoonbutton.pack()
self.eveningbutton=tkinter.Button()
self.eveningbutton["text"]="Evening"
self.eveningbutton["command"]=self.evening
self.eveningbutton.pack()
self.quitbutton=tkinter.Button()
self.quitbutton["text"]="Quit"
self.quitbutton["command"]=self.quit
self.quitbutton.pack()
def morning(self):
print("Good Morning!")
def afternoon(self):
print("Good Afternoon!")
def evening(self):
print("Hello World!")
def quit(self):
print("Good Bye!")
root=tkinter.Tk()
app=Application(master=root)
app.mainloop()