from tkinter import *
from tkinter import messagebox
import win32api, win32con, time
class OrdinaryCalculator(object):
def __init__(self, win=None):
self.win = win
def windows(self):
self.root = Tk()
self.root.wm_attributes('-topmost', 1)
self.root.title("计算器")
self.root.geometry("280x480+800+500")
self.root.resizable(False, False)
self.text = Text(self.root, width=25, font=("微软雅黑", 15), height=7, bd=6)
self.text.pack()
f1 = Frame(self.root)
b1 = Button(f1, text="切换", width=4, height=1, font=("微软雅黑", 18), fg='white', bg="gray", command=self.handover)
b2 = Button(f1, text="← ", width=4, height=1, font=("微软雅黑", 18), fg='white', bg="orange", command=self.getDel)
b3 = Button(f1, text="AC", width=4, height=1, font=("微软雅黑", 18), fg='white', bg='red', command=self.getAC)
b4 = Button(f1, text="%", width=4, height=1, font=("微软雅黑", 18), fg='white', bg="gray", command=self.getPercent)
b1.pack(side=LEFT, padx=1, pady=1)
b2.pack(side=LEFT, padx=1, pady=1)
b3.pack(side=LEFT, padx=1, pady=1)
b4.pack(side=LEFT, padx=1, pady=1)
f1.pack()
f2 = Frame(self.root)
b5 = Button(f2, text="7", width=4, height=1, font=("微软雅黑", 18), bg="white", command=self.get7)
b6 = Button(f2, text="8", width=4, height=1, font=("微软雅黑", 18), bg="white", command=self.get8)
b7 = Button(f2, text="9", width=4, height=1, font=("微软雅黑", 18), bg="white", command=self.get9)
b8 = Button(f2, text="÷", width=4, height=1, font=("微软雅黑", 18), fg='white', bg="gray", command=self.getDevide)
b5.pack(side=LEFT, padx=1, pady=1)
b6.pack(side=LEFT, padx=1, pady=1)
b7.pack(side=LEFT, padx=1, pady=1)
b8.pack(side=LEFT, padx=1, pady=1)
f2.pack()
f3 = Frame(self.root)
b9 = Button(f3, text="4", width=4, height=1, font&