Set or return the line thickness. Aliases: pensize | width Argument: width -- positive number Set the line thickness to width or return it. If resizemode is set to "auto" and turtleshape is a polygon, that polygon is drawn with the same line thickn
(self, width=None)
| 2138 | self.pen(resizemode=rmode) |
| 2139 | |
| 2140 | def pensize(self, width=None): |
| 2141 | """Set or return the line thickness. |
| 2142 | |
| 2143 | Aliases: pensize | width |
| 2144 | |
| 2145 | Argument: |
| 2146 | width -- positive number |
| 2147 | |
| 2148 | Set the line thickness to width or return it. If resizemode is set |
| 2149 | to "auto" and turtleshape is a polygon, that polygon is drawn with |
| 2150 | the same line thickness. If no argument is given, current pensize |
| 2151 | is returned. |
| 2152 | |
| 2153 | Example (for a Turtle instance named turtle): |
| 2154 | >>> turtle.pensize() |
| 2155 | 1 |
| 2156 | >>> turtle.pensize(10) # from here on lines of width 10 are drawn |
| 2157 | """ |
| 2158 | if width is None: |
| 2159 | return self._pensize |
| 2160 | self.pen(pensize=width) |
| 2161 | |
| 2162 | |
| 2163 | def penup(self): |