python turtle教程2

2025-04-18 17:04:08

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
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢