[Tutor] creating Turtle() object using 2 different ways

spir denis.spir at gmail.com
Sat Feb 1 09:55:10 CET 2014


On 01/31/2014 10:38 PM, Alan Gauld wrote:
> If you want multiple turtles you should use
> the first version.

Yes, the turtle module has a global turtle that can be used by people playing 
with a single turtle, and prefere conventional procedural programming style, 
rather than object-oriented (OO). If you need multiple turtle or prefere OO, 
then you need to first create an OO turtle as you did, using turtle.Turtle().
(It's all explained in the docs: http://docs.python.org/3/library/turtle.html :
<< The turtle module provides turtle graphics primitives, in both 
object-oriented and procedure-oriented ways. >> )

d





More information about the Tutor mailing list