有没有那么一瞬间,
想学习一下桌面应用程序开发?
建议此次课程大家稍作了解不要浪费太多时间,
因为没有哪家公司会招聘以为Python程序员开发桌面程序吧?
开发环境:
界面设置
import tkinter as tk
root = tk.Tk()
root.title('计算器')
root.geometry("295x280+150+150")
root.attributes("-alpha", 0.9)
root["background"] = "#ffffff"
lable1 = tk.Label(root, textvariable=result_num, width=20, height=2, font=('宋体', 20), justify='left', background='#ffffff', anchor='se')
lable1.grid(padx=4, pady=4, row=0, column=0, columnspan=4)
button_clear = tk.Button(root, text='C', width=5, font=('宋体', 16), relief='flat', background='#C0C0C0', command=lambda: clear())
button_back = tk.Button(root, text='←', width=5, font=('宋体', 16), relief='flat', background='#C0C0C0', command=lambda: back())
button_division = tk.Button(root, text='/', width=5, font=('宋体', 16), relief='flat', background='#C0C0C0', command=lambda: operator('/'))
button_multiplication = tk.Button(root, text='x', width=5, font=(