kab*_*oex 5 python ipython python-2.7 python-3.x
我改变了乌龟的这些属性,它们似乎做了同样的事情,就是使画的线变大或变小,这两个属性有什么区别?它们似乎是同一件事
没有区别,turtle.width()
都是别名turtle.pensize()
。这是显示的文档字符串help(turtle.pensize)
:
海龟模块中函数 pensize 的帮助:
pensize(width=None) 设置或返回线条粗细。
Run Code Online (Sandbox Code Playgroud)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