极客小将

您现在的位置是:首页 » python编程资讯

资讯内容

怎么用python写窗口程序

极客小将2020-12-29-
简介Python也可以创建界面,需要导入tkinter具体看代码:from tkinter import *def btnClick():    textLabel['text']='我点击了按钮&#

uec少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

python也可以创建界面,需要导入tkinter
具体看代码:uec少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

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()

uec少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

更多技术请关注python视频教程。uec少儿编程网-Scratch_Python_教程_免费儿童编程学习平台

网友点评

共有5条评论来说两句吧...

在线客服