PyDocs

Nav

Graphical user interfaces with Tk

Shape

turtle

class
  • Shape(type_, data)
Data structure modeling shapes. type_ is one of the strings “polygon”, “image” or “compound”. What data must be depends on type_: for “polygon” a tuple of pairs of coordinates, for “image” an image (only used internally), and for “compound” None, as a compound shape is built up using the addcomponent() method.
Members of Shape

a

addcomponent
Add a component to a shape of type “compound”.
1 Example
>>> s = Shape("compound")
>>> poly1 = ((0,0), (10,-5), (0,10), (-10,-5))
>>> s.addcomponent(poly1, "red", "blue")
>>> poly2 = ((0,0), (10,-5), (-10,-5))
>>> s.addcomponent(poly2, "blue", "red")
from the Python docs
See Also
No see-alsos for turtle/Shape
0 Notes
No notes for Shape