Advertisement
dino3vr

Untitled

Feb 15th, 2020
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. import msvcrt
  2.  
  3. cant_input = list(map(str, string.ascii_letters)) + [str(x) for x in range(10)]
  4.  
  5. def Input():
  6.     INPUT = ''
  7.     key = ''
  8.     while True:
  9.         if msvcrt.kbhit():
  10.             key = str(msvcrt.getch())
  11.             key = key.split('\'')[1]
  12.  
  13.             if key not in cant_input and key != '\\r':
  14.                 INPUT += key
  15.                 print(key, end='')
  16.             elif key == '\\r':
  17.                 return INPUT
  18.  
  19. print(Input())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement