T
T
Timebird2017-07-27 00:21:25
Python
Timebird, 2017-07-27 00:21:25

Is it possible to block the possibility of entering literal data into the console, similar to Delphi?

Hello!
I wonder what the function is called when, when entering data into some window / console, the ability to enter letters was basically blocked? That is, for example, you can enter only numbers and only two-digit ones. I know that there is such a function in Delphi, but I forgot what it is called: I'm interested in having one in python.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aynur_safin, 2017-07-27
@aynur_safin

If you mean the Delphi functions of the Character.IsLetter/IsNumber type, then Python has isalpha and so on.
https://docs.python.org/3/library/stdtypes.html#st...
you can filter on input.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question