Skip to content

Instantly share code, notes, and snippets.

@ramalho
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save ramalho/ca3a355b3df471e29282 to your computer and use it in GitHub Desktop.

Select an option

Save ramalho/ca3a355b3df471e29282 to your computer and use it in GitHub Desktop.
Turtle graphics on the Raspberry Pi
Double-click LXTerminal and type:
$ idle -n
(the IDLE window appears)
>>> from turtle import *
>>> fd(100)
(a window with a line appears)
How to draw a square:
>>> fd(100)
>>> rt(90)
>>> fd(100)
>>> rt(90)
>>> fd(100)
>>> rt(90)
>>> fd(100)
>>> rt(90)
IDLE menu:
File -> New Window
(a blank window appears, you type:)
from turtle import *
def tri(size):
fd(size)
rt(120)
fd(size)
rt(120)
fd(size)
rt(120)
File -> Save
figura.py [Save]
(abrir Python Shell)
>>> from figura import *
>>> tri(100)
>>> rt(10)
>>> tri(90)
>>> rt(10)
>>> tri(90)
>>> rt(10)
>>> for n in range(36):
... rt(10)
... tri(90)
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment