I am working with a GUI and I'm trying to get the user input to only be an integer and an error label needs to show if it is blank or not an integer. I know the code below isn't right but I've been toying with different methods I'm reading and I can't seem to put something together that makes sense. At one point the error label was showing whenever I pressed the save button no matter what was put and then when I tried string values I got the error that's listed below the code. Please let me know if you have an idea or need more information. Thank you!
def minutes():
while len(self.sideAuto.get()) == 0:
try:
self.sideAuto = int(input())
except ValueError:
ttk.Label(self, text="Must be valid integer.").grid(column=2, row=2, sticky=tk.E)
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\jenna\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 537, in get
return self._tk.getint(value)
_tkinter.TclError: expected integer but got "x"