Advertisement
AntonioVillanueva

Lectura teclado no bloqueante

Jul 16th, 2021
1,683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. #!/usr/bin/python3
  2. import select , sys
  3.  
  4. def lecture():
  5.         input=select.select([sys.stdin],[],[],1)[0]
  6.         if input:
  7.                 return sys.stdin.readline().rstrip()# resultado
  8.         return ""
  9.  
  10. while True:
  11.     print (lecture())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement