Ask coding questions

← Back to all posts
Auto Enter
KidNext2Ben (0)

Is there a way to make python enter the first thing you type in a input (with out you clicking ‘enter’)

Commentshotnewtop
Scoder12 (349)

Yes. You can use

import sys
import tty
tty.setraw(sys.stdin)
letter = sys.stdin.read(1) # put however many characters you want
print(letter)

I am a repl.it helper. If this is a good answer please upvote.