I need to limit the entry to a maximum of 5 digits.
def validate(S):
try:
float(S)
return True
except ValueError:
messagebox.showerror(message="Datos erroneos, únicamente números.", title="ERROR")
return False
e1 = tk.Entry(master, validate="key", validatecommand=(master.register(validate), '%S'))
I have this method to receive and validate that it's just numbers at the entry, but i would like to know how can I put a max limit of 5 digits on the entry.
I tried with the methods used in this question (Tkinter entry character limit) but it is not working with the validate method.