Skip to content

Instantly share code, notes, and snippets.

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