What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-25 04:17:04
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.tcset... Add solution -
Python 2021-09-14 19:50:01
python non blocking input
#! /usr/bin/python3 """Treat input if available, otherwise exit without blocking""" import sys import select def something(line): print('read input:', line, end='') def something_else(): print('no input') # If there'... Add solution
Best helpers
Ranking is empty