turtle width 和 pensize 区别?
turtle width and pensize Difference?
我改变了乌龟的这些属性,它们似乎做了同样的事情,就是让画的线变大或变小,这两个属性有什么区别?他们似乎是同一件事
没有区别,turtle.width()
是turtle.pensize()
的别名。这是 help(turtle.pensize)
:
显示的文档字符串
Help on function pensize in module turtle:
pensize(width=None)
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 thickness. If no argument is given, current pensize
is returned.
Example:
>>> pensize()
1
>>> pensize(10) # from here on lines of width 10 are drawn
我改变了乌龟的这些属性,它们似乎做了同样的事情,就是让画的线变大或变小,这两个属性有什么区别?他们似乎是同一件事
没有区别,turtle.width()
是turtle.pensize()
的别名。这是 help(turtle.pensize)
:
Help on function pensize in module turtle:
pensize(width=None) 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 thickness. If no argument is given, current pensize is returned. Example: >>> pensize() 1 >>> pensize(10) # from here on lines of width 10 are drawn