forked from markandey007/hacktoberfest_2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tkinter
32 lines (21 loc) · 1.04 KB
/
tkinter
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
from tkinter import *
root = Tk() #window
root.title("Calculator")
en = Entry(root, width=50, borderwidth=10)
en.grid(row=0,column=0,columnspan=3,padx=10,pady=10)
def bt_a():
return
bt=Button(root,text="0",padx=30,pady=10,command=bt_a).grid(row=4,column=0)
bt1=Button(root,text="1",padx=30,pady=10,command=bt_a).grid(row=3,column=0)
bt2=Button(root,text="2",padx=30,pady=10,command=bt_a).grid(row=3,column=1)
bt3=Button(root,text="3",padx=30,pady=10,command=bt_a).grid(row=3,column=2)
bt4=Button(root,text="4",padx=30,pady=10,command=bt_a).grid(row=2,column=0)
bt5=Button(root,text="5",padx=30,pady=10,command=bt_a).grid(row=2,column=1)
bt6=Button(root,text="6",padx=30,pady=10,command=bt_a).grid(row=2,column=2)
bt7=Button(root,text="7",padx=30,pady=10,command=bt_a).grid(row=1,column=0)
bt8=Button(root,text="8",padx=30,pady=10,command=bt_a).grid(row=1,column=1)
bt9=Button(root,text="9",padx=30,pady=10,command=bt_a).grid(row=1,column=2)
my_label = Label(root,text="Hello World!") #creating label
#printing on screen
# my_label.pack()
root.mainloop()