79643363

Date: 2025-05-29 05:52:26
Score: 11 🚩
Natty: 4
Report link

I have a similar problem which I havent solved yet. I only want to input numbers from 0-9 and a "." if I want to input a float number. So far I have this:

def keylistener(event):
    ACCEPTED = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "."]
    if not event.char in ACCEPTED:
        pass 
        # Dont let the character be inputed
#....

tk.bind('<KeyPress>', keylistener)

can anyone help me?

Reasons:
  • Blacklisted phrase (1): help me
  • Blacklisted phrase (1): I have a similar problem
  • RegEx Blacklisted phrase (3): can anyone help me
  • RegEx Blacklisted phrase (1): I want
  • Has code block (-0.5):
  • Me too answer (2.5): I have a similar problem
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Raydrake