How do i change the text in entry?
from tkinter import * import string import random cisla = string.digits symboly = string.punctuation abeceda = string.ascii_letters heslo = [] root = Tk() root.title(“PASSWORD GENERATOR”) delkahesla = Entry(root, width=35) delkahesla.insert(0, “How many letters would you like?”) Psymboly = Entry(root, width=35) Psymboly.insert(0, “How many symbols would you like?”) Pcisla = Entry(root, width=35) Pcisla.insert(0, “How many numbers […]
python / TkInter Entry value sometimes got, sometimes not
I am facing an issue that looks strange to me.
I just want my program to get the data entered by the user in an Entry field and print it in the std out.
for so I use TkInter and an Entry widget, bound to a StringVar and a button to trigger the display.
when I make a single window, that is to say the Entry is in the main window, all runs smoothly.
though, when this very window is displayed after pressing a button on a parent window, things go wrong … the get() on the StringVar looks getting nothing.
As you may see, this is the same code in both cases.
Any ideas ? It looks like a bug, but as I am a bit noob …