pythontkinter实现画出计算器界面的示例-创新互联
这篇文章主要介绍python tkinter实现画出计算器界面的示例,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
创新互联公司专注于东湖企业网站建设,响应式网站设计,成都商城网站开发。东湖网站建设公司,为东湖等地区提供建站服务。全流程按需定制,专业设计,全程项目跟踪,创新互联公司专业和态度为您提供的服务需求:设计能计算加法的计算器界面
代码演示:
from tkinter import * # 创建窗体 root = Tk() #添加标题 root.title("求两数之和") root.geometry("700x80") photo = PhotoImage(file = "/Users/yushengtan/Desktop/calc.png") PhotoLabel = Label(root,image = photo).pack(side = LEFT,padx = 10,pady = 5) #文本框 Entry01 = Entry(root,bg = "pink",width = 10,font = ("黑体",20)).pack(side = LEFT,padx = 5,pady = 5) Label_plus = Label(root,text = "+",font = ("黑体",20)).pack(side = LEFT,padx = 5,pady = 5) #文本框 Entry02 = Entry(root,bg = "pink",width = 10,font = ("黑体",20)).pack(side = LEFT,padx = 5,pady = 5) Label_equal = Label(root,text = "=",font = ("黑体",20)).pack(side = LEFT,padx = 5,pady = 5) #文本框 Entry03 = Entry(root,bg = "green",width = 10,font = ("华文黑体",20)).pack(side = LEFT,padx = 5,pady = 5) Button01 = Button(root,text = "计算",width = 10,height = 2,font = ("华文黑体",15)).pack(side = LEFT,padx = 10,pady = 5) # 运行 root.mainloop()
运行效果演示:
以上是python tkinter实现画出计算器界面的示例的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注创新互联行业资讯频道!
名称栏目:pythontkinter实现画出计算器界面的示例-创新互联
当前地址:http://azwzsj.com/article/dheeec.html