Stop input function in python

user3586056

I would like to stop the user to type in too many characters in the input function so it just stops the input() when too many characters are put in but the characters previously typed in stay. In this case I wouln't want to check if this is after the user has pressed enter but I would like to interrupt the function. Is this somehow possible?

user2835118

Might be possible with a loop and msvcrt. Here is an example:

while len(string) < 10:
#Whatever length you want instead of 10
    string += msvcrt.getch()

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

python stop recursion in a function

From Dev

if input has reached 7 digits, stop the function

From Dev

Python: How to stop a looping function inside a function?

From Dev

Python range function - stop step is function

From Dev

Python: Stop thread that is waiting for user input

From Dev

Defining Python function with input

From Dev

How to stop a call of function before the option's choose in select input

From Dev

Stop a loop inside function in Python 3

From Dev

Python Start & stop a continous function with Gtk Switch

From Dev

Use user input within as input in a function Python

From Dev

Python : Skip the input function with timeout

From Dev

Python - Passing input (prompt) into Function

From Dev

Calling a function with a variable input in Python

From Dev

Parallelizing python function with dictionary as input

From Dev

How to stop subprocess.Popen waiting for user input in python

From Dev

Why does code stop at input() in python - what are the benefits?

From Dev

Why does code stop at input() in python - what are the benefits?

From Dev

how to stop input() from main thread in python3

From Dev

How to stop reading input from user after a certain char using raw_input() in Python?

From Dev

How to stop reading input from user after a certain char using raw_input() in Python?

From Dev

Stop detecting Input in Unity?

From Dev

cgi - stop reading input

From Dev

Stop detecting Input in Unity?

From Dev

Stop prompt() redirecting to input

From Dev

Using raise function to stop execution of further code in python after an error

From Dev

How can I stop the execution of a Python function from outside of it?

From Dev

Python unittest and mock: Check if a function gets called, but then stop the test

From Dev

Access function and stop threading media and servo subprocess in python

From Dev

How to pass a list as an input of a function in Python

Related Related

  1. 1

    python stop recursion in a function

  2. 2

    if input has reached 7 digits, stop the function

  3. 3

    Python: How to stop a looping function inside a function?

  4. 4

    Python range function - stop step is function

  5. 5

    Python: Stop thread that is waiting for user input

  6. 6

    Defining Python function with input

  7. 7

    How to stop a call of function before the option's choose in select input

  8. 8

    Stop a loop inside function in Python 3

  9. 9

    Python Start & stop a continous function with Gtk Switch

  10. 10

    Use user input within as input in a function Python

  11. 11

    Python : Skip the input function with timeout

  12. 12

    Python - Passing input (prompt) into Function

  13. 13

    Calling a function with a variable input in Python

  14. 14

    Parallelizing python function with dictionary as input

  15. 15

    How to stop subprocess.Popen waiting for user input in python

  16. 16

    Why does code stop at input() in python - what are the benefits?

  17. 17

    Why does code stop at input() in python - what are the benefits?

  18. 18

    how to stop input() from main thread in python3

  19. 19

    How to stop reading input from user after a certain char using raw_input() in Python?

  20. 20

    How to stop reading input from user after a certain char using raw_input() in Python?

  21. 21

    Stop detecting Input in Unity?

  22. 22

    cgi - stop reading input

  23. 23

    Stop detecting Input in Unity?

  24. 24

    Stop prompt() redirecting to input

  25. 25

    Using raise function to stop execution of further code in python after an error

  26. 26

    How can I stop the execution of a Python function from outside of it?

  27. 27

    Python unittest and mock: Check if a function gets called, but then stop the test

  28. 28

    Access function and stop threading media and servo subprocess in python

  29. 29

    How to pass a list as an input of a function in Python

HotTag

Archive