pensize() 函数的示例
import turtle step=100 turtle.penup() turtle.setposition(-400, 0) turtle.pendown() turtle.speed(1) turtle.write(0.001) turtle.pensize(0.001) turtle.forward(step) turtle.write(0.01) turtle.pensize(0.01) turtle.forward(step) turtle.write(0.01) turtle.pensize(0.1) turtle.forward(step) turtle.write(1) turtle.pensize(1) turtle.forward(step) turtle.write(10) turtle.pensize(10) turtle.forward(step) turtle.write(100) turtle.pensize(100) turtle.forward(step) #turtle.write(1000) #turtle.pensize(1000) #turtle.forward(step) turtle.done()
可以看出最小是1像素,最大不限制。