how to get input from user in python with out press enter
import keyboard
while not keyboard.ispressed("s"):
print("none")
if keyboard.ispressed("s"):
print("bottun pressed!")
how to get input from user in python with out press enter
import keyboard
while not keyboard.ispressed("s"):
print("none")
if keyboard.ispressed("s"):
print("bottun pressed!")
Input without pressing enter python
import tty, sys, termios
filedescriptors = termios.tcgetattr(sys.stdin)
tty.setcbreak(sys.stdin)
x = 0
while 1:
x=sys.stdin.read(1)[0]
print("You pressed", x)
if x == "r":
print("If condition is met")
termios.tcsetattr(sys.stdin, termios.TCSADRAIN,filedescriptors)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us