-
-
Save stephengruppetta/2c936ff7fe45f2795ca7c7de9dc22320 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 | |
window = turtle.Screen() | |
typewriter = turtle.Turtle() | |
def type_letter(character): | |
typewriter.write(character, font=("Courier", 30, "normal")) | |
typewriter.forward(30) | |
window.onkeypress( | |
functools.partial(type_letter, "a"), | |
"a", | |
) | |
window.listen() | |
turtle.done() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment