0

What I wanted was that if the user hasn't written his name, the program would say that he needs to do so.

Here is the code that you need to see:

window = tk.Tk()
entry = Entry(window,...

if len(entry) == 0:
    print("Please write your username!")
Mike - SMT
  • 14,784
  • 4
  • 35
  • 79
daniel
  • 11
  • 1
  • 1
    First replace `len(entry)` with `len(entry.get())`. The `get()` is needed to pull the value from the entry field. That is assuming your `if` statement is inside of some function. If it is not it needs to be. – Mike - SMT Dec 07 '22 at 18:11

0 Answers0