forked from Techsrijan/summer2025
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtkinterbutton.py
More file actions
30 lines (27 loc) · 814 Bytes
/
tkinterbutton.py
File metadata and controls
30 lines (27 loc) · 814 Bytes
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
from tkinter import *
def msg():
print("hello")
def msg2():
print("hi")
root=Tk()
root.title("My first window")
btn=Button(root,text="click me", fg="red",bg="yellow",
font=("comic sans ms",25,'bold'),
command=msg)
btn.pack(side=TOP,fill=X)
btn1=Button(root,text="Add", fg="red",bg="yellow",
font=("comic sans ms",25,'bold'),
command=msg2)
btn1.pack(side=LEFT,fill=Y)
btn12=Button(root,text="sub", fg="red",bg="yellow",
font=("comic sans ms",25,'bold'),
command=msg2)
btn12.pack(side=RIGHT)
btn123=Button(root,text="mul", fg="red",bg="yellow",
font=("comic sans ms",25,'bold'),
command=msg2)
btn123.pack(side=BOTTOM)
root.geometry("400x400+500+200")
root.resizable(0,0)
root.wm_iconbitmap('cal.ico')
root.mainloop()