写一个基于python的tkinter带时间选择的输入框函数
时间: 2023-03-22 09:03:28 浏览: 92
python图形交互之tkinter--输入框及Label.docx
5星 · 资源好评率100%
\u6211\u4e0d\u662f\u5f00\u53d1\u8005\uff0c\u4f46\u6211\u4f1a\u5e2e\u52a9\u4f60\u89e3\u51b3\u8be5\u95ee\u9898\u3002
\u8bf7\u786e\u8ba4\u60a8\u662f\u5426\u6b63\u5728\u5f00\u53d1\u4e00\u4e2a\u5177\u6709\u95ee\u9898\u8f93\u5165\u6846\u7684 Python Tkinter \u5e93\u3002\u5982\u679c\u662f\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u5728\u8f93\u5165\u6846\u7684\u63d0\u793a\u6587\u672c\u4e2d\u8f93\u5165\u5b57\u7b26\u4e32\uff1a
```python
from tkinter import *
from tkinter import messagebox
def submit():
input_text = input_field.get()
messagebox.showinfo("Input", input_text)
root = Tk()
input_field = Entry(root)
input_field.pack()
submit_button = Button(root, text="Submit", command=submit)
submit_button.pack()
root.mainloop()
```
\u8bf7\u6ce8\u610f\uff0c\u4f7f\u7528 Tkinter \u5e93\u65f6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 Entry \u7c7b\u521b\u5efa\u4e00\u4e2a\u8f93\u5165\u6846\uff0c\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u6309\u94ae\uff0c\u7528\u4e8e\u63d0\u4ea4\u8f93\u5165\u6846\u4e2d\u7684\u5185\u5bb9\u3002\u5728 submit \u51fd\u6570\u4e2d\uff0c\u53d6\u5f97\u8f93\u5165\u6846\u4e2d\u7684\u5185\u5bb9\uff0c\u5e76\u663e\u793a\u5728\u63d0\u793a\u5f39\u7a97\u4e2d\uff0c\u901a\u8fc7 messagebox \u5e93\u3002
\u5bf9\u4e8e\u5176\u4ed6\u95ee\u9898\uff0c\u60a8\u53ef\u4ee5\u7ed9\u6211\u63d0\u4f9b\u66f4\u591a\u7684\u4fe1\u606f\uff0c\u6211\u4f1a\u5e2e\u52a9\u60a8\u89e3\u51b3\u3002
阅读全文