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
2 Antworten
+ 2
enter_text = StrVar()
enter = tk.Entry(root, textvariable=enter_text)
then just use .set() and .get() on the textvariable
+ 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