# 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();
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有