You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3096976
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: source/simple_drawing.rst
+20-12Lines changed: 20 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,9 @@ required to make it work from files. Just go to your terminal and type::
19
19
20
20
.. note::
21
21
22
-
Not seeing anything on Mac OS? Try issuing a command like ``turtle.forward(0)`` and looking if a new window opened behind your command line.
22
+
Not seeing anything on Mac OS? Try issuing a command like
23
+
``turtle.forward(0)`` and looking if a new window opened behind your
24
+
command line.
23
25
24
26
.. note::
25
27
@@ -29,7 +31,10 @@ required to make it work from files. Just go to your terminal and type::
29
31
30
32
.. note::
31
33
32
-
While it might be tempting to just copy and paste what's written on this page into your terminal, we encourage you to type out each command. Typing gets the syntax under your fingers (building that muscle memory!) and can even help avoid strange syntax errors.
34
+
While it might be tempting to just copy and paste what's written on
35
+
this page into your terminal, we encourage you to type out each command.
36
+
Typing gets the syntax under your fingers (building that muscle memory!)
37
+
and can even help avoid strange syntax errors.
33
38
34
39
::
35
40
@@ -45,12 +50,14 @@ required to make it work from files. Just go to your terminal and type::
45
50
46
51
47
52
The ``turtle.forward(...)`` function tells the turtle to move forward
48
-
by the given distance. ``turtle.left(...)`` takes a number of degrees which you want
49
-
to rotate to the left. (There are ``turtle.backward(...)`` and
50
-
``turtle.right(...)``, too.)
53
+
by the given distance. ``turtle.left(...)`` takes a number of degrees which you
54
+
want to rotate to the left. There is also ``turtle.backward(...)`` and
55
+
``turtle.right(...)``, too.
51
56
52
57
.. note::
53
-
Want to start fresh? You can type ``turtle.reset()`` to clear the drawing that your ``turtle`` has made so far. We'll go into more detail on ``turtle.reset()`` in just a bit.
58
+
Want to start fresh? You can type ``turtle.reset()`` to clear the drawing
59
+
that your ``turtle`` has made so far. We'll go into more detail on
60
+
``turtle.reset()`` in just a bit.
54
61
55
62
The standard turtle is just a triangle. That's no fun! Let's make it a turtle
56
63
instead with the ``turtle.shape()`` command::
@@ -76,10 +83,10 @@ until you click on it::
76
83
77
84
.. note::
78
85
79
-
Python is a programming language where horizontal indenting of text is
80
-
important. We'll learn all about this in the Functions chapter later on,
81
-
but for now just keep in mind that stray spaces or tabs before any line
82
-
of Python code will cause an unexpected error.
86
+
Python is a programming language where horizontal indenting of text is
87
+
important. We'll learn all about this in the Functions chapter later on,
88
+
but for now just keep in mind that stray spaces or tabs before any line
89
+
of Python code can cause an unexpected error.
83
90
84
91
Drawing a square
85
92
================
@@ -142,7 +149,9 @@ key to exit the pager.
142
149
143
150
NameError: name 'turtle' is not defined
144
151
145
-
when trying to view help? In Python you have to import names before you can refer to them, so in a new Python interactive shell you'll need to ``import turtle`` before ``help(turtle.color)`` will work.
152
+
when trying to view help? In Python you have to import names before you
153
+
can refer to them, so in a new Python interactive shell you'll need to
154
+
``import turtle`` before ``help(turtle.color)`` will work.
146
155
147
156
Another way to find out about functions is to browse the `online documentation`_.
0 commit comments