Calculator using python tkinter
You can use the function to evaluate mathematical expressions entered by the user. You can also use Tkinter buttons and entry widgets to create a simple calculator interface. import tkinter from tkinter import * root=Tk() root.title("Simple Calculator") root.geometry("570x600+100+100") root.resizable(False,False) root.configure(bg="#17161b") equation = "" def show(value): global equation equation+=value label_result.config(text=equation) def clear(): global equation equation = "" label_result.config(text=equation) def calculation(): global equation result = "" if equation !="": try: result = eval(equation) except: result = "error" equation = "" l...
Comments
Post a Comment