Skip to content
← Back to Community
Auto Enter
Profile icon
SilentS100

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

Voters
Profile icon
jamesfullam
Profile icon
EvanErickson1
Profile icon
AdaAja1
Profile icon
MrDitto
Profile icon
SilentS100
Comments
hotnewtop
Profile icon
Scoder12

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.

Profile icon
HarperframeInc

Maybe getch?