Last active
March 10, 2019 14:04
-
-
Save lqez/48eed8795d0f85b528962b310d895ed0 to your computer and use it in GitHub Desktop.
From a to z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import getch | |
import time | |
print("Type from a to z.") | |
print("Timer will begin after typing the first letter 'a'.") | |
print("Quit: Ctrl + C") | |
while True: | |
c = ord('a') | |
begin = None | |
while True: | |
char = getch.getch() | |
if ord(char) != c: | |
continue | |
if not begin: | |
begin = time.time() | |
print(char, end='', flush=True) | |
c += 1 | |
if c > ord('z'): | |
break | |
end = time.time() | |
print('\t', end - begin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need
getch
to run.pip install getch