Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import msvcrt
- cant_input = list(map(str, string.ascii_letters)) + [str(x) for x in range(10)]
- def Input():
- INPUT = ''
- key = ''
- while True:
- if msvcrt.kbhit():
- key = str(msvcrt.getch())
- key = key.split('\'')[1]
- if key not in cant_input and key != '\\r':
- INPUT += key
- print(key, end='')
- elif key == '\\r':
- return INPUT
- print(Input())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement