手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

python turtle教程2

时间:2024-10-30 19:30:38

1、画圆 circleturtle.circle(radius,angle,step)radius决定了圆的尺寸angle决定了圆整体角度st髫潋啜缅ep是画这个圆所有的线段总和,用1则是一笔画成,如果要够圆,理论越大越好,直接推荐不设置这个参数。

python turtle教程2
python turtle教程2

2、画点 dotturtle.dot(radius,color)radius决定了点的尺寸color决定了点的填充颜色不给参数与当前画笔的尺寸大小,颜色有关

python turtle教程2

3、刻印 stampturtle.stamp()将当前箭头刻印在画布上函数返回刻印的id

python turtle教程2

4、消除刻印 clearstampturtle.clearstamp(id)消除id为id的刻印

python turtle教程2

5、消除成组刻印 clearstampsturtle.clearstamps(2)#消除前2个刻印turtle.艘早祓胂clearstamps(-2)#消除后2个刻印turtle.clearstamps()#消除所有刻印

python turtle教程2

6、撤销操作 undoturtle.undo()undo只对移动有效,刻印什么的无法恢复

python turtle教程2

7、设置移动速度 speedturtle.speed()返回当前画笔的移动速度turtle.speed(x)#更改速度为x

python turtle教程2
© 手抄报圈