python turtle库常用方法

  1. reset()
    Delete the turtle’s drawings from the screen, re-center the turtle and set variables to the default values.
    删除屏幕上目前的图像,将画笔置于中间,并将各变量重置默认值。
  2. clear()
    Delete the turtle’s drawings from the screen. Do not move turtle. State and position of the turtle as well as drawings of other turtles are not affected.
    删除屏幕上目前的图像,不移动画笔。画笔和其他画笔的状态和位置不受影响。
  3. mode(mode=None)
    设置乌龟模式(“standard”,“logo”或“world”)并执行重置。如果没有给出模式,则返回当前模式。
    standard:向右(东),逆时针
    logo:向上(北),顺时针
    world:使用用户自定义的方式
  4. home()
    Move turtle to the origin – coordinates (0,0) – and set its heading to its start-orientation (which depends on the mode, see mode()).
    移动画笔到圆点-坐标(0,0)-并且设置它的头部朝向为它的初始朝向(依赖于mode()方法)
  5. begin_poly()
    Start recording the vertices of a polygon. Current turtle position is first vertex of polygon.
    开始记录多边形的顶点。当前画笔位置是多边形第一顶点。
  6. end_poly()
    Stop recording the vertices of a polygon. Current turtle position is last vertex of polygon. This will be connected with the first vertex.
    停止记录多边形顶点。当前画笔位置是多边形最后一个顶点,并将与第一个顶点连接。
  7. get_poly()
    Return the last recorded polygon.
    返回上一个记录的多边形。
  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值