the relevant code part:
def display_img(root:tk.Tk,img:str) -> None:
img=tk.PhotoImage(file=img)
panel = tk.Label(root, image = img)
panel.pack(side = "bottom", fill = "both", expand = "yes")
root.mainloop()
def run_automat(automat: Automat):
automat.end()
root=tk.Tk()
root.configure(background="black")
display_img(root,automat.draw())
i=input("next:")
while i!="":
automat.step(i)
automat.draw()
i=input("next:")
print(automat.end())
def execute_str(s: str, automat: Automat) -> bool:
automat.end()
for i in s:
automat.step(i)
return automat.end()
while True:
run_automat(automat)
when i show the state it freezez and i cant input the next letter