-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTkinter_class.py
69 lines (58 loc) · 1.31 KB
/
Tkinter_class.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from tkinter import *
# tr=Tk()
#
# class Lp:
# def __init__(self,rt1):
# fr=Frame(rt1)
# fr.pack()
# Button(fr,text='START',command=self.start).pack()
# Button(fr,text='STOP',command=fr.quit).pack()
#
# def start(self):
# print('Start Coding')
#
# obj=Lp(tr)
#
# tr.mainloop()
#=====================================================================
# tr=Tk()
#
# class Lp:
# def __init__(self):
# Button(text='START',command=self.start).pack()
# Button(text='STOP',command=quit).pack()
#
# def start(self):
# print('Start Coding')
#
# obj=Lp()
#
# tr.mainloop()
#===============================================================
root=Tk()
class code:
def __init__(self):
f=Frame(root)
f.pack()
Button(f,text='Hello',command=self.print).pack()
Button(f,text='exit',command=quit).pack()
def print(self):
print('Hello')
ob=code()
root.mainloop()
#----------------- or else -------------------------------
# root=Tk()
#
# class code:
# def __init__(self,one):
# f=Frame(one)
# f.pack()
# Button(f,text='Hello',command=self.print).pack()
# Button(f,text='exit',command=quit).pack()
#
# def print(self):
# print('Hello')
#
# ob=code(root)
#
# root.mainloop()