首页 > 编程语言 > 详细

Python GUI编程(Tkinter)Button控件

时间:2020-02-19 21:26:47      阅读:58      评论:0      收藏:0      [点我收藏+]
import tkinter

def func():
print("sunck is a good man")

win = tkinter.Tk()
win.title("sunck")
win.geometry("400x400+200+20")

#创建按钮
button1 = tkinter.Button(win, text="按钮", command=func, width=10, height=10)
button1.pack()

button2 = tkinter.Button(win, text="按钮", command=win.quit)
button2.pack()

win.mainloop()

Python GUI编程(Tkinter)Button控件

原文:https://www.cnblogs.com/pygo/p/12333008.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!