(self)
return stitem
Stamp a copy of the turtleshape onto the canvas and return its id.

        No argument.

        Stamp a copy of the turtle shape onto the canvas at the current
        turtle position. Return a stamp_id for that stamp, which can be
        used to delete it by calling clearstamp(stamp_id).

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> turtle.stamp()
        13
        >>> turtle.fd(50)
Stamp a copy of the turtleshape onto the canvas and return its id.
Stamp a copy of the turtleshape onto the canvas and return its id .
def stamp(self):
        """Stamp a copy of the turtleshape onto the canvas and return its id.

        No argument.

        Stamp a copy of the turtle shape onto the canvas at the current
        turtle position. Return a stamp_id for that stamp, which can be
        used to delete it by calling clearstamp(stamp_id).

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> turtle.stamp()
        13
        >>> turtle.fd(50)
        """
        screen = self.screen
        shape = screen._shapes[self.turtle.shapeIndex]
        ttype = shape._type
        tshape = shape._data
        if ttype == "polygon":
            stitem = screen._createpoly()
            if self._resizemode == "noresize": w = 1
            elif self._resizemode == "auto": w = self._pensize
            else: w =self._outlinewidth
            shape = self._polytrafo(self._getshapepoly(tshape))
            fc, oc = self._fillcolor, self._pencolor
            screen._drawpoly(stitem, shape, fill=fc, outline=oc,
                                                  width=w, top=True)
        elif ttype == "image":
            stitem = screen._createimage("")
            screen._drawimage(stitem, self._position, tshape)
        elif ttype == "compound":
            stitem = []
            for element in tshape:
                item = screen._createpoly()
                stitem.append(item)
            stitem = tuple(stitem)
            for item, (poly, fc, oc) in zip(stitem, tshape):
                poly = self._polytrafo(self._getshapepoly(poly, True))
                screen._drawpoly(item, poly, fill=self._cc(fc),
                                 outline=self._cc(oc), width=self._outlinewidth, top=True)
        self.stampItems.append(stitem)
        self.undobuffer.push(("stamp", stitem))
        return stitem
def stamp ( self ) : screen = self . screen shape = screen . _shapes [ self . turtle . shapeIndex ] ttype = shape . _type tshape = shape . _data if ttype == "polygon" : stitem = screen . _createpoly ( ) if self . _resizemode == "noresize" : w = 1 elif self . _resizemode == "auto" : w = self . _pensize else : w = self . _outlinewidth shape = self . _polytrafo ( self . _getshapepoly ( tshape ) ) fc , oc = self . _fillcolor , self . _pencolor screen . _drawpoly ( stitem , shape , fill = fc , outline = oc , width = w , top = True ) elif ttype == "image" : stitem = screen . _createimage ( "" ) screen . _drawimage ( stitem , self . _position , tshape ) elif ttype == "compound" : stitem = [ ] for element in tshape : item = screen . _createpoly ( ) stitem . append ( item ) stitem = tuple ( stitem ) for item , ( poly , fc , oc ) in zip ( stitem , tshape ) : poly = self . _polytrafo ( self . _getshapepoly ( poly , True ) ) screen . _drawpoly ( item , poly , fill = self . _cc ( fc ) , outline = self . _cc ( oc ) , width = self . _outlinewidth , top = True ) self . stampItems . append ( stitem ) self . undobuffer . push ( ( "stamp" , stitem ) ) return stitem