Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- def calculator():
- res = '{}'. format(txt.get())
- res = int(res)
- lbl.configure(text=res)
- window = Tk()
- window.title('calculator')
- window.geometry('400x250')
- btn = Button(window, text = '~~~', command=calculator)
- btn.grid(column=6, row=0)
- lbl = Label(window, text='0')
- lbl.grid(column=8, row=0)
- txt = Entry(window,width=10)
- txt.grid(column=4, row = 0)
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement