Can you tell which shapes are currently available?

1

I'm using the turtle of Python module and would like to know if you have a way to know what types of shape that turtle can take . I know you can create or add more shapes to the TurtleScreen dictionary, but honestly I did not have time to read the entire documentation and I'm not sure what she was talking about right now.

    
asked by anonymous 25.09.2014 / 22:36

1 answer

2

As the documentation (emphasis mine):

  

turtle.shape(name=None)

     

Parameters: name - a string that is a valid form name

     

Make the shape of the turtle the one with the given name or, if the name was not given, returns the name of the current shape. A form with the name name must exist in the shape dictionary of TurtleScreen . Initially there are the following polygonal forms: " arrow ", " turtle ", " circle ", " square ", " triangle ", " classic ". To learn how to deal with shapes, see the Screen register_shape() method.

Update: For a list of supported form names - both standard and developer-added - dynamically, you can use the getshapes of TurtleScreen :

>>> Screen().getshapes()
['arrow', 'blank', 'circle', 'classic', 'square', 'triangle', 'turtle']

Note: I'm not sure if this is the best way to get an instance of TurtleScreen , as I'm a beginner in this library.

    
25.09.2014 / 23:35