MCPcopy Index your code
hub / github.com/python/cpython / pensize

Method pensize

Lib/turtle.py:2140–2160  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 5

dotMethod · 0.80
demo2Function · 0.80
mainFunction · 0.80
__init__Method · 0.80
treeFunction · 0.80

Calls 1

penMethod · 0.95

Tested by

no test coverage detected