Python:GUI
程序员文章站
2022-06-22 13:00:30
# code: utf-8 # writer: Geovin Du 涂聚 文 import os; import sys; from tkinter import *; #GUI 自带的 另有:wxPython,PyQt5,PythonCard,Dabo等 from tkinter.messageb... ......
# code: utf-8
# writer: geovin du 涂聚 文
import os;
import sys;
from tkinter import *; #gui 自带的 另有:wxpython,pyqt5,pythoncard,dabo等
from tkinter.messagebox import showinfo;
def reply(name):
showinfo(title='gui测试', message='你好! %s!' % name);
# 应用窗口
window=tk();
window.title('获取用户输入:涂聚文') #窗体标题
#window.iconbitmap('py-blue-trans-out.ico'); #自定义窗体的图标
label(window,text='输入你的名字:').pack(side=top);
ent=entry(window);
ent.pack(side=top);
button=button(window,text='确定',command=(lambda:reply(ent.get())));
button.pack(side=left);
window.mainloop();
下一篇: Django admin简单介绍