发布时间:2019-09-06 08:53:45编辑:auto阅读(2207)
Python也可以创建界面,需要导入tkinter
具体看代码:
from tkinter import *
def btnClick():
textLabel['text']='我点击了按钮'
root = Tk(className="我的第一个窗口程序");
textLabel = Label(root,text = '提示显示',justify=LEFT,padx=10)
textLabel.pack(side = TOP)
btn = Button(root)
btn['text']='点击测试'
btn['command'] = btnClick
btn.pack(side = BOTTOM)
mainloop()
运行结果:
点击按钮:
上一篇: python 打印矩阵
下一篇: scala调用python
50967
50346
40963
37830
32296
29186
28074
22902
22864
21197
1057°
1736°
1423°
1356°
1625°
1445°
2103°
3650°
3573°
2519°