Basic Gui Calculator In Tkinter Python

0
from tkinter import *

root = Tk()
root.geometry('555x444')
root.title('this is calculator')

def calculator():
	Valueing = values.get()
	results.set(eval(Valueing))

Label(root, text='Calculate Here').pack()
values = StringVar()
Entry(root, textvariable=values).pack()

Button(root, text='Calculate!', font='lucida 13 bold' , bg='#f50e5d', fg='white', padx='20', pady='10', command=calculator).pack(pady='30')

Label(root, text='Result').pack()
results = StringVar()
Entry(root, textvariable=results).pack()

root.mainloop()
Tags

Post a Comment

0Comments

If you have any doubts, please let me know

Post a Comment (0)