How to recuparate an inputed text in a varable in tkinter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to recuparate an inputed text in a varable in tkinter

Hello! Ok we get this code: enter = tk.Entry(root, textvariable = value) What i want is to recuparate the text that the user is going to input in a variable. Thanks

28th Apr 2021, 7:44 AM
Bonheur Massonama
2 Answers
+ 2
enter_text = StrVar() enter = tk.Entry(root, textvariable=enter_text) then just use .set() and .get() on the textvariable
28th Apr 2021, 9:23 AM
Slick
Slick - avatar
+ 1
exemple: # first declare the variable type myvalue = IntVar() or StringVar() enter = tk.Entry(root, textvariable= myvalue) enter.get(myvalue) # help yourself with this basic password generator coded with python and tkinter https://www.github.com/IT-Support-L2/Advanced-Password-Generator/tree/main/gen_p.py
28th Apr 2021, 2:18 PM
iTech
iTech - avatar