【发布时间】:2018-10-30 11:32:16
【问题描述】:
python 中是否有任何库可用于图形用户输入输入。我知道tk,但我相信需要一些代码才能做到这一点。我正在寻找最短的解决方案。
a = input('Enter your string here:')
我想要一个对话框来代替这个,以便用户可以在那里输入。
这没有达到目的。这仅显示对话框,您不能提供输入条目。
import ctypes # An included library with Python install.
ctypes.windll.user32.MessageBoxW(0, "Your text", "Your title", 1)
【问题讨论】:
-
没关系。 :) 我想避免使用外部库。
-
@iCodez 和 RishuA。当您删除对话的第一部分而不是其余部分时,其他人会感到很困惑。
-
啊!似乎在编辑时被删除了。来自手机。
-
这就是我正在使用的。 root = tk.Tk() root.withdraw() in_csv_file = simpledialog.askstring("Some_Name", "Enter CSV file Name",parent=root)
-
RishuA:要格式化 cmets 中的代码,请使用反引号(`)字符,将代码括在其中。像这样:
root = tk.Tk()root.withdraw()in_csv_file = simpledialog.askstring("Some_Name", "Enter CSV file Name",parent=root)
标签: python python-3.x user-interface tkinter