import turtle as t# 设置速度
t.speed(100)  # 速度
t.delay(10)  # 延迟
# turtle.tracer(False)
# 双耳
# 左耳
t.penup()
t.goto(-150, 200)
t.setheading(160)
t.begin_fill()
t.pendown()
t.circle(-30, 230)
t.setheading(180)
t.circle(37, 90)
t.end_fill()
# 右耳
t.penup()
t.goto(60, 200)
t.setheading(20)
t.begin_fill()
t.pendown()
t.circle(30, 230)
t.setheading(0)
t.circle(-37, 90)
t.end_fill()
# 头
t.pensize(5)
t.penup()
t.goto(-113, 237)
t.setheading(30)
t.pendown()
t.circle(-134, 60)t.penup()
t.goto(-150, 200)
t.setheading(-120)
t.pendown()
t.circle(200, 80)t.penup()
t.goto(60, 200)
t.setheading(-60)
t.pendown()
t.circle(-200, 80)t.penup()
t.setheading(210)
t.pendown()
t.circle(-120, 60)
# 双眼
# 左眼
# 眼圈
t.penup()
t.goto(-140, 100)
t.setheading(-45)
t.begin_fill()
t.pendown()
a = 0.2
for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.1t.lt(3)  # 向左转3度t.fd(a)  # 向前走a的步长else:a = a - 0.1t.lt(3)t.fd(a)
t.end_fill()
# 眼白
t.fillcolor("white")
t.penup()
t.goto(-103, 125)
t.setheading(0)
t.begin_fill()
t.pendown()
t.circle(14, 360)
t.end_fill()
# 眼珠
# t.fillcolor("sienna")
# t.pencolor("sienna")
t.penup()
t.goto(-102, 133)
t.setheading(0)
t.begin_fill()
t.pendown()
t.circle(6, 360)
t.end_fill()
# 右眼
# 眼圈
t.penup()
t.goto(50, 100)
t.setheading(45)
t.fillcolor("black")
t.pencolor("black")
t.begin_fill()
t.pendown()
a = 0.2
for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.1t.lt(3)  # 向左转3度t.fd(a)  # 向前走a的步长else:a = a - 0.1t.lt(3)t.fd(a)
t.end_fill()
# 眼白
t.fillcolor("white")
t.penup()
t.goto(13, 125)
t.setheading(0)
t.begin_fill()
t.pendown()
t.circle(14, 360)
t.end_fill()
# 眼珠
# t.fillcolor("sienna")
# t.pencolor("sienna")
t.penup()
t.goto(12, 133)
t.setheading(0)
t.begin_fill()
t.pendown()
t.circle(6, 360)
t.end_fill()
# 鼻子
t.pencolor("black")
t.fillcolor("black")
t.penup()
t.goto(-55, 133)
t.begin_fill()
t.pendown()
t.fd(20)
t.seth(-120)
t.fd(20)
t.seth(120)
t.fd(20)
t.end_fill()
# 嘴
t.penup()
t.goto(-70, 110)
t.setheading(-30)
t.fillcolor("red")
t.begin_fill()
t.pendown()
t.circle(50, 60)
t.setheading(-120)
t.circle(-100, 15)
t.circle(-15, 90)
t.circle(-100, 15)
t.end_fill()
# 四肢
# 左臂
t.penup()
t.goto(-175, 100)
t.fillcolor("black")
t.begin_fill()
t.setheading(-120)
t.pendown()
t.fd(100)
t.setheading(-110)
t.circle(20, 180)
t.fd(30)
t.circle(-5, 160)
t.end_fill()
# 右臂
t.penup()
t.goto(85, 100)
t.setheading(60)
t.begin_fill()
t.pendown()
t.fd(100)
t.setheading(70)
t.circle(20, 180)
t.fd(30)
t.circle(-5, 160)
t.end_fill()
# 小红心
t.penup()
t.pencolor("red")
t.fillcolor('red')
t.goto(105, 200)
t.begin_fill()
t.pendown()
t.circle(-5, 180)
t.setheading(90)
t.circle(-5, 180)
t.setheading(-120)
t.fd(17)
t.penup()
t.goto(105, 200)
t.pendown()
t.setheading(-60)
t.fd(17)
t.end_fill()
t.pencolor("black")
t.fillcolor("black")
# 左腿
t.penup()
t.goto(-120, -45)
t.begin_fill()
t.pendown()
t.setheading(-90)
t.circle(-140, 20)
t.circle(5, 109)
t.fd(30)
t.circle(10, 120)
t.setheading(90)
t.circle(-140, 10)
t.end_fill()
# 右腿
t.penup()
t.goto(30, -45)
t.begin_fill()
t.pendown()
t.setheading(-90)
t.circle(140, 20)
t.circle(-5, 109)
t.fd(30)
t.circle(-10, 120)
t.setheading(90)
t.circle(140, 10)
t.end_fill()
# 冰糖外壳
t.pensize(3)
t.penup()
t.goto(-160, 195)
t.setheading(160)
t.pendown()
t.circle(-40, 230)
t.setheading(30)
t.circle(-134, 58)
t.setheading(60)
t.circle(-40, 215)
t.setheading(-60)
t.fd(15)
t.circle(2, 200)
t.setheading(65)
t.fd(30)
t.circle(-25, 180)
t.fd(100)
t.circle(2, 25)
t.circle(-200, 47)
t.circle(2, 60)
t.circle(140, 23)
t.circle(-2, 90)
t.setheading(180)
t.fd(70)
t.circle(-2, 90)
t.fd(30)
t.setheading(-160)
t.circle(-100, 35)
t.setheading(-90)
t.fd(30)
t.circle(-2, 90)
t.fd(70)
t.circle(-2, 90)
t.setheading(60)
t.circle(140, 30)
t.circle(2, 45)
t.circle(-200, 19)
t.circle(2, 130)
t.fd(30)
t.circle(-25, 180)
t.fd(100)
t.setheading(90)
t.circle(-200, 30)
# 冰糖面罩
t.pensize(3)
t.penup()
t.goto(65, 120)
t.setheading(90)
t.pendown()
t.pencolor("red")
a = 1
for i in range(120):if 0 <= i < 30 or 60 <= i < 90:  # 控制a的变化a = a + 0.25t.lt(3)  # 向左转3度t.fd(a)  # 向前走a的步长else:a = a - 0.25t.lt(3)t.fd(a)
t.pencolor("orange")
t.penup()
t.goto(66, 120)
t.pendown()
a = 1
for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.255t.lt(3)t.fd(a)else:a = a - 0.255t.lt(3)t.fd(a)
t.pencolor("green")
t.penup()
t.goto(67, 120)
t.pendown()
a = 1
for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.2555t.lt(3)t.fd(a)else:a = a - 0.2555t.lt(3)t.fd(a)
t.pencolor("deep sky blue")
t.penup()
t.goto(68, 120)
t.pendown()
a = 1
for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.25955t.lt(3)t.fd(a)else:a = a - 0.25955t.lt(3)t.fd(a)
t.pencolor("pink")
t.penup()
t.goto(71, 120)
t.pendown()
a = 1
for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.26t.lt(3)t.fd(a)else:a = a - 0.26t.lt(3)t.fd(a)
t.pencolor("purple")
t.penup()
t.goto(72, 120)
t.pendown()
a = 1
for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.269t.lt(3)t.fd(a)else:a = a - 0.269t.lt(3)t.fd(a)# 五环
t.penup()
t.goto(-55, -10)
t.pendown()
t.pencolor("blue")
t.circle(10)
t.penup()
t.goto(-40, -10)
t.pendown()
t.pencolor("black")
t.circle(10)
t.penup()
t.goto(-25, -10)
t.pendown()
t.pencolor("red")
t.circle(10)
t.penup()
t.goto(-50, -20)
t.pendown()
t.pencolor("yellow")
t.circle(10)
t.penup()
t.goto(-30, -20)
t.pendown()
t.pencolor("green")
t.circle(10)t.done()

Python海龟作图相关推荐

  1. python turtle绕原点旋转_「加德老师与小朋友们的编程之旅」Python海龟作图(上)

    加德老师寄语: 小朋友们,家长朋友们,大家好! [加德老师与小朋友们的编程之旅]今天迎来第二节课--用python进行海龟作图(上) Python被誉为现今人工智能第一语言,适合9岁以上孩子进行编程入 ...

  2. python海龟作图不用循环_我用Python告诉老大爷“啥是佩奇”

    " 今天,被<啥是佩奇>这支广告片刷屏了.佩奇明明是个喜剧角色,却看哭了所有人. 快过年了,在农村爷爷给城里的小孙子打电话,小孙子说想要"佩奇",为了满足小孙 ...

  3. python海龟作图20秒完成小猪佩奇,附源码!

    Python(发音:英[?pa?θ?n],美[?pa?θɑ:n]),是一种面向对象.直译式电脑编程语言,也是一种功能强大的通用型语言,已经具有近二十年的发展历史,成熟且稳定.它包含了一组完善而且容易理 ...

  4. Python—海龟作图

    1.因为海龟作图需要用到"turtle"库,所以先介绍库的三种引用方法: (1):from 库名 import 函数名/ * : (2):import 库名 -->使用时:库 ...

  5. python海龟作图好看图案_编程入门 06:Python 海龟绘图

    编程入门 06:Python 海龟绘图 现在让我们开始尝试图形用户界面 (GUI) 程序的编写 Python 标准库中有个 turtle 模块, 可以生成标准的应用程序窗口进行图形绘制 turtle ...

  6. python海龟作图好看图案_python海龟绘图,其实python也很强大,这些技能你知道吗?...

    Turtle库 简介 什么是Turtle 首先,turtle库是一个点线面的简单图像库,能够完成一些比较简单的几何图像可视化.它就像一个小乌龟,在一个横轴为x.纵轴为y的坐标系原点,(0,0)位置开始 ...

  7. python海龟作图好看图案_Python中的高级turtle(海龟)作图

    在Python里,海龟不仅可以画简单的黑线,还可以用它画更复杂的几何图形,用不同的颜色,甚至还可以给形状填色. 一.从基本的正方形开始 引入turtle模块并创建Pen对象: >>> ...

  8. python海龟作图好看图案_海龟作图---用Python绘图

    一.关于Turtle "turtle是一个简单的绘图工具.它提供了一个海龟,你可以把它理解为一个机器人,只听得懂有限的指令" 操纵海龟绘图有着许多的命令,这些命令可以划分为两种:一 ...

  9. python海龟作图红绿灯_海龟作图---用Python绘图

    一.关于Turtle "turtle是一个简单的绘图工具.它提供了一个海龟,你可以把它理解为一个机器人,只听得懂有限的指令" 操纵海龟绘图有着许多的命令,这些命令可以划分为两种:一 ...

最新文章

  1. Ubuntu15.10安装XAMPP
  2. Java线程的状态转换
  3. Direct3D学习_绘制流水线
  4. Google 都在用的 6 个休息小技巧,让你工作效率翻倍
  5. 使用C#为MSTest测试项目实现自定义断言
  6. audio 上一首 下一首 自定义样式_被 iPhone 吹爆的最香功能,安卓也终于安排上了...
  7. 破解 语序点选验证码
  8. 高数篇:11.01多元函数求极限方法
  9. AVKit  做一个页面类似于B站的视频页面 (第一种做法)
  10. 在mybatis中怎么书写工具类,也就是创建一个sqlsessionFactory
  11. 《卫报》评全球最具影响力博客50强 徐静蕾入选
  12. 计算机中丢失rtutil,api-ms-win-core-winrt-string-l1-1-0.dll从您的计算机中丢失
  13. Docker 之 高级篇(应用复杂安装、DockerFile、Docker网络、Docker-compose、可视化工具)
  14. 爬虫(21)crawlspider讲解古诗文案例补充+小程序社区案例+汽车之家案例+scrapy内置的下载文件的方法
  15. lezhin漫画账号注册登录教程
  16. 西瓜皮——被丢掉的真金白银,夏天的健康守护神
  17. 老农移石故事的启示分享
  18. 【遇见Doris】寒冷冬日的一次温暖相聚 · Doris开发者沙龙
  19. 用友突然不能建立跟应用服务器,解决用友:不能建立跟应用服务器(xxx机器名)所指向的数据库服务器连接...
  20. 机器翻译:西班牙文「---」英文

热门文章

  1. linux 后台运行 nohup
  2. iOS AttributedString简介
  3. 最新采集下载QQ空间相册照片的方法
  4. Python bisect模块详解
  5. eclipse 基础快捷键。
  6. 每天一点点 PS制作照片撕裂效果
  7. 织梦cms php中调用当前频道,DEDE织梦CMS模板在runphp=yes的标签中调用其他field值的方法...
  8. [原创] 照片仿手绘:优质帅哥
  9. 2014年度总结篇 之 我要九阴真经
  10. 手动屏蔽 QQ 图片广告 教程 适用于任何版本