Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created August 15, 2023 07:22
Show Gist options
  • Save stephengruppetta/a72b9f805e4ecc349473b57686d6eac7 to your computer and use it in GitHub Desktop.
Save stephengruppetta/a72b9f805e4ecc349473b57686d6eac7 to your computer and use it in GitHub Desktop.
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