-
-
Save stephengruppetta/a72b9f805e4ecc349473b57686d6eac7 to your computer and use it in GitHub Desktop.
This file contains 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 functools | |
import turtle | |
import string | |
window = turtle.Screen() | |
typewriter = turtle.Turtle() | |
def type_letter(character): | |
typewriter.write(character, font=("Courier", 30, "normal")) | |
typewriter.forward(30) | |
for character in string.ascii_letters: | |
window.onkeypress( | |
functools.partial(type_letter, character), | |
character, | |
) | |
window.listen() | |
turtle.done() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment