Skip to content

Instantly share code, notes, and snippets.

@lipemat
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lipemat/63eebd59c43da1c697a0 to your computer and use it in GitHub Desktop.
Save lipemat/63eebd59c43da1c697a0 to your computer and use it in GitHub Desktop.
import turtle;
t = turtle.Turtle();
w = turtle.Screen();
def right():
t.right(45);
def left():
t.left(45);
def up():
t.forward( 2 );
def down():
t.back( 2 );
w.onkey( right, "Right" );
w.onkey( left, "Left" );
w.onkey( up, "Up" );
w.onkey( down, "Down" );
w.listen();
@lipemat
Copy link
Author

lipemat commented May 10, 2014

This is like the most basic arbitrary example of turtle screen events. It is used strictly for teaching a beginner programmer some python basics.

Not to be used as a reference for my coding ability. I mean seriously guys. I would have to drink about 10 shots to numb my brain to the level of actually doing something useful with python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment