Tkinter 5. 输入对话框
作者:
JunChen | 来源:发表于
2022-10-17 15:46 被阅读0次
tkinter.simpledialog模块
函数
- askfloat(title, prompt, **kw)
- askinteger(title, prompt, **kw)
- askstring(title, prompt, **kw)
实例
import tkinter.simpledialog
import tkinter as tk
root = tk.Tk()
root.geometry('600x400')
ety = tk.Entry(root)
ety.pack()
def select():
ety.delete(0,tk.END)
s = tkinter.simpledialog.askstring(title='请输入',prompt='请输入名字')
ety.insert(0,s)
btn = tk.Button(root,text='...',command=select)
btn.pack()
root.mainloop()
本文标题:Tkinter 5. 输入对话框
本文链接:https://www.haomeiwen.com/subject/vhzxortx.html
网友评论