乌龟宽度和pensize差异?

时间:2015-05-27 03:40:37

标签: python python-2.7 python-3.x ipython

我改变了乌龟的这些属性,他们似乎做了同样的事情,这使得线条绘制得更大或更小,这两个属性之间有什么区别?他们似乎是一回事

1 个答案:

答案 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