Line


Without the call to turtle.exitonclick() at the end of the program it would automatically close the window and we would not be able to see anything. This command installs an event-handler so when we click on the mouse it will end the application.

examples/turtle/line.py
import turtle

trt = turtle.getturtle()
trt.forward(100)

turtle.exitonclick()