标签:
from tkinter import * win = Tk() win.geometry(‘500x300+400+300‘) win[‘bg‘] = ‘#0099ff‘ win.title(‘魔方小子‘) e = Entry(win) e.pack() j = Label(win,text=‘+‘) j.pack() d = Entry(win) d.pack() i = Label(win,text=‘||‘) i.pack() s = Entry(win) s.pack() def fun(): ej = int(e.get()) de = int(d.get()) t = ej + de t = str(t) s.insert(0,t) def run(): e.delete(0,END) d.delete(0,END) s.delete(0,END) k = Button(win,text=‘计算‘,command=fun) k.pack() kb = Button(win,text=‘清除‘,command=run) kb.pack() win.mainloop()
标签:
原文地址:http://www.cnblogs.com/wumac/p/5800581.html