Python Tkinter Prompt

I am trying to prompt the user to enter a line of text. Is javascript hint accessible via python tkinter?

+3
source share
5 answers

Yes, use tkSimpleDialog.askstring . Unfortunately, this does not apply to the main Python documents, so they are a little difficult to find.

+7
source

try the following:

import tkinter
x = tkinter.tkSimpleDialog.askstring
+4
source

, , , , .

tkSimpleDialog.

+1

"/"

from tkinter import *
answer = tkinter.messagebox.askquestion
+1

, ,

python 2.7:

from Tkinter import *
root = Tk()
E = Entry(root)
E.pack()
root.mainloop()

python 3:

from Tkinter import *
root = Tk()
E = Entry(root)
E.pack()
root.mainloop()
-2

Source: https://habr.com/ru/post/1722071/


All Articles