怎么用python写窗口程序
发布时间:2026-07-02 22:00:11

Python还可以创建界面,需要导入tkinter以查看代码:
fromtkinterimport* defbtnClick(): 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视频教程,了解更多技术。
下一篇 python怎么使用迭代器
