python turtle 各种示例

 

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()

python turtle 各种示例

 

 可以看出最小是1像素,最大不限制。

 

上一篇:神经网络-nn.Module


下一篇:禁止页面后退JS(兼容各浏览器)