Skip to content Skip to sidebar Skip to footer

How To Accept Input Without The Need To Press Enter Python 3

i'm wondering how to accept input without the need to press enter. i searched online, and i get something regarding raw_input, but i think that became obsolete after the arrival of

Solution 1:

If you are using windows, msvcrt is the answer:

import msvcrt

print("Please enter a value.")char= msvcrt.getch()
print char

If you are not using windows, take a look at the following snippet at this source:

getch = _Getch()
print ("Please enter something: ")
x = getch()
print x

Post a Comment for "How To Accept Input Without The Need To Press Enter Python 3"