我改变了乌龟的这些属性,他们似乎做了同样的事情,这使得线条绘制得更大或更小,这两个属性之间有什么区别?他们似乎是一回事
答案 0 :(得分:1)
没有区别,turtle.width()
是turtle.pensize()
的别名。以下是help(turtle.pensize)
显示的文档字符串:
帮助模块龟中的函数pensize:
pensize(宽度=无) 设置或返回线条粗细。
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