I've created some simple functions to limit my entry, but I'm a little bit stuck:
first of all def lowercase_letter_entry
is not working and it do not edit my entry in lowercase. Second the functions that work they only do so once, after that they are kinda useless. I did try to solve this with for
and while true
but I've only managed to make repeat an infinity of time the warning message.
Also I know is kinda of a dumb question but right now I'm using the function changing my_entry in what variable I need. Is there a way to make the def "neutral" and make them work with all my entry without having to edit the name? (hope I've menage to make a little of sense.
import tkinter
from tkinter import messagebox
def lowercase_letter_entry(P):
if P.isalpha() or P == "":
if P.islower():
return True
else:
if not P.islower():
P.get()lower()
return True
else:
messagebox.showwarning("Warning","Only letters are allowed")
return False
Thank you and have a nice day!