I started develeping a simple app with Tkinter module of python. My codes are not very complex but when I click the button on the screen, Pycharm freezes. Here is my code below,
from random import *
from tkinter import *
window=Tk()
luckynumber=randint(0,50)
def GuessGame():
guessedNumber=int(guessdigit.get())
while True:
if guessedNumber == luckynumber:
cx2=Label(window,text="Congrats!",font=("Fixedsys",20))
cx2.grid(row=3,column=0)
break
elif guessedNumber < luckynumber:
cx2 =Label(window, text="You have to guess more than that!", font=
("Fixedsys", 20))
cx2.grid(row=3, column=0)
elif guessedNumber > luckynumber:
cx2 =Label(window, text="You have to guess less than that!", font=
("Fixedsys", 20))
cx2.grid(row=3, column=0)
cx1=Label(window,text="You have to guess the number!",font=("Fixedsys",20))
cx1.grid(row=0,column=0)
guessdigit=Entry(window,font=("Fixedsys",20))
guessdigit.grid(row=1,column=0)
cx3=Button(window,text="To submit your guess, click it!",font=
("Fixedsys",20),command=GuessGame)
cx3.grid(row=2,column=0)
window=mainloop()