Hardware Reference
In-Depth Information
You cannot save this code because you wrote it directly into the Python interpreter
window or shell so that you could see it working instantly. In the following sections,
you will type your sequence of steps for the turtle to follow in a text editor window.
You can learn more about using Turtle Graphics with Python by selecting the
PythonTurtleShapes video from the companion website at www.wiley.com/
go/adventuresinrp .
Using a Text Editor
As you begin to create more complex programs, it will become tiresome to type the
commands straight into the Python interpreter or shell window. It makes more sense
to type all your code into a text ile before running it, using IDLE.
To open the text editor, click File New Window from the menu at the top of the
Python 3 interpreter or shell. Type in all the code that you typed into the interpreter in
the preceding section, and save the new ile to your Documents directory on your
Raspberry Pi as FirstTurtle.py (see Figure 4-11). You can run the script by clicking
Run Run Module from the text editor toolbar.
FIGURE 4-11 Using the text editor to create and save iles
Search WWH ::




Custom Search