+ 1
Single character input?
How to make single character input in python?like getch() is there any function in python
7 Réponses
+ 5
If you just want to work without using Return-key, there seems to be no easy way. But you can check this post, there are several approaches explained:
https://stackoverflow.com/questions/510357/JUMP_LINK__&&__python__&&__JUMP_LINK-read-a-single-character-from-the-user
+ 2
swim....ah...didn't notice you already had the [0] in you original response..forgive me.
I just realised what Lilas was looking for....(although a python version)
When using getch() from the conio header file..there is no need to hit "enter" after entering a character...but.......my code snippet doesn't do that.....sorry Lilas.
+ 2
thanks for help But i have to press enter after that.any other solution plz
+ 1
Wasn't sure if this would work...but... had a go and it does actually work..
myinput = input()[0]
print(myinput)