Quantcast
Channel: Indefinitely move Python turtle while allowing input - Stack Overflow
Browsing index pages (2 articles)

Indefinitely move Python turtle while allowing input

I've just started working on a version of Snake using Turtle, and I've encountered an issue. I want the snake to move indefinitely, but also to allow the user to move the snake with the keyboard. I got...

View Article


Answer by cdlane for Indefinitely move Python turtle while allowing input

An event-driven environment like turtle should never have while True: as it potentially blocks out events (e.g. keyboard). Use an ontimer() event instead.Generally, onkey() and listen() don't belong in...

View Article

Browsing index pages (2 articles)


Latest Images