import turtle as t

def DrawPeiqi():

t.pensize(4)

t.hideturtle()

t.colormode(255)

t.color((255,155,192),"pink")

t.setup(840,500)

t.speed(10)

#鼻子

t.pu()

t.goto(-100,100)

t.pd()

t.seth(-30)

t.begin_fill()

a=0.4

for i in range(120):

if 0<=i<30 or 60<=i<90:

a=a+0.08

t.lt(3) #向左转3度

t.fd(a) #向前走a的步长

else:

a=a-0.08

t.lt(3)

t.fd(a)

t.end_fill()

t.pu()

t.seth(90)

t.fd(25)

t.seth(0)

t.fd(10)

t.pd()

t.pencolor(255,155,192)

t.seth(10)

t.begin_fill()

t.circle(5)

t.color(160,82,45)

t.end_fill()

t.pu()

t.seth(0)

t.fd(20)

t.pd()

t.pencolor(255,155,192)

t.seth(10)

t.begin_fill()

t.circle(5)

t.color(160,82,45)

t.end_fill()

#头

t.color((255,155,192),"pink")

t.pu()

t.seth(90)

t.fd(41)

t.seth(0)

t.fd(0)

t.pd()

t.begin_fill()

t.seth(180)

t.circle(300,-30)

t.circle(100,-60)

t.circle(80,-100)

t.circle(150,-20)

t.circle(60,-95)

t.seth(161)

t.circle(-300,15)

t.pu()

t.goto(-100,100)

t.pd()

t.seth(-30)

a=0.4

for i in range(60):

if 0<=i<30 or 60<=i<90:

a=a+0.08

t.lt(3) #向左转3度

t.fd(a) #向前走a的步长

else:

a=a-0.08

t.lt(3)

t.fd(a)

t.end_fill()

#耳朵

t.color((255,155,192),"pink")

t.pu()

t.seth(90)

t.fd(-7)

t.seth(0)

t.fd(70)

t.pd()

t.begin_fill()

t.seth(100)

t.circle(-50,50)

t.circle(-10,120)

t.circle(-50,54)

t.end_fill()

t.pu()

t.seth(90)

t.fd(-12)

t.seth(0)

t.fd(30)

t.pd()

t.begin_fill()

t.seth(100)

t.circle(-50,50)

t.circle(-10,120)

t.circle(-50,56)

t.end_fill()

#眼睛

t.color((255,155,192),"white")

t.pu()

t.seth(90)

t.fd(-20)

t.seth(0)

t.fd(-95)

t.pd()

t.begin_fill()

t.circle(15)

t.end_fill()

t.color("black")

t.pu()

t.seth(90)

t.fd(12)

t.seth(0)

t.fd(-3)

t.pd()

t.begin_fill()

t.circle(3)

t.end_fill()

t.color((255,155,192),"white")

t.pu()

t.seth(90)

t.fd(-25)

t.seth(0)

t.fd(40)

t.pd()

t.begin_fill()

t.circle(15)

t.end_fill()

t.color("black")

t.pu()

t.seth(90)

t.fd(12)

t.seth(0)

t.fd(-3)

t.pd()

t.begin_fill()

t.circle(3)

t.end_fill()

#腮

t.color((255,155,192))

t.pu()

t.seth(90)

t.fd(-95)

t.seth(0)

t.fd(65)

t.pd()

t.begin_fill()

t.circle(30)

t.end_fill()

#嘴

t.color(239,69,19)

t.pu()

t.seth(90)

t.fd(15)

t.seth(0)

t.fd(-100)

t.pd()

t.seth(-80)

t.circle(30,40)

t.circle(40,80)

#身体

t.color("red",(255,99,71))

t.pu()

t.seth(90)

t.fd(-20)

t.seth(0)

t.fd(-78)

t.pd()

t.begin_fill()

t.seth(-130)

t.circle(100,10)

t.circle(300,30)

t.seth(0)

t.fd(230)

t.seth(90)

t.circle(300,30)

t.circle(100,3)

t.color((255,155,192),(255,100,100))

t.seth(-135)

t.circle(-80,63)

t.circle(-150,24)

t.end_fill()

#手

t.color((255,155,192))

t.pu()

t.seth(90)

t.fd(-40)

t.seth(0)

t.fd(-27)

t.pd()

t.seth(-160)

t.circle(300,15)

t.pu()

t.seth(90)

t.fd(15)

t.seth(0)

t.fd(0)

t.pd()

t.seth(-10)

t.circle(-20,90)

t.pu()

t.seth(90)

t.fd(30)

t.seth(0)

t.fd(237)

t.pd()

t.seth(-20)

t.circle(-300,15)

t.pu()

t.seth(90)

t.fd(20)

t.seth(0)

t.fd(0)

t.pd()

t.seth(-170)

t.circle(20,90)

#脚

t.pensize(10)

t.color((240,128,128))

t.pu()

t.seth(90)

t.fd(-75)

t.seth(0)

t.fd(-180)

t.pd()

t.seth(-90)

t.fd(40)

t.seth(-180)

t.color("black")

t.pensize(15)

t.fd(20)

t.pensize(10)

t.color((240,128,128))

t.pu()

t.seth(90)

t.fd(40)

t.seth(0)

t.fd(90)

t.pd()

t.seth(-90)

t.fd(40)

t.seth(-180)

t.color("black")

t.pensize(15)

t.fd(20)

#尾巴

t.pensize(4)

t.color((255,155,192))

t.pu()

t.seth(90)

t.fd(70)

t.seth(0)

t.fd(95)

t.pd()

t.seth(0)

t.circle(70,20)

t.circle(10,330)

t.circle(70,30)

python turtle 绘图小猪佩奇_Python turtle画小猪佩奇相关推荐

  1. python turtle 绘图表情包_Python|turtle|画表情包

    今天依然来熟悉一下python中的turtle模块,在这之前我们来看一条段子,也是我无意间get到的,胆小者勿看,因为太wu了.段子是:嫦娥的兔子生病了,于是嫦娥把兔子抱到月老那里.月老看了看兔子说: ...

  2. python turtle怎么用变量_Python Turtle绘图指定变量时出现问题

    几小时后我有一个作业要交,我不知道该做什么. 我使用的是python3.在 我一直试着运行代码,但是我出错了.在这一点上,我想我应该寻求帮助.在 提前谢谢你!在import turtle import ...

  3. python用turtle调整文字位置_Python turtle学习笔记

    一.简介 Turtle最早来自于LOGO语言,是专门用于小孩子学习编程的,通过编程模拟一只turtle(海龟)在画板上爬行绘制图案,后来很多高级语言都移植了海龟绘图,python从2.6之后也将tur ...

  4. python中的turtle库中引用_python turtle库学习笔记

    1.turtle库是python语言中一个很流行的绘制图像的函数库 想象一只小乌龟,在一个横轴为x,纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它 ...

  5. python turtle库的使用_Python turtle库使用教程

    1.基础概念 1 画布(canvas) 画布就是turtle为我们展开用于绘图区域, 我们可以设置它的大小和初始位置. 常用的画布方法有两个:screensize()和setup(). (1)turt ...

  6. python中mainloop什么意思_Python Turtle mainloop()用法

    我有一个online tutorial的以下代码来学习基于事件的编程,方法是在点击鼠标时使停止灯改变状态.这里是我的代码的全部:Python Turtle mainloop()用法 import tu ...

  7. python里turtle.circle什么意思_Python turtle.circle方法代碼示例

    本文整理匯總了Python中turtle.circle方法的典型用法代碼示例.如果您正苦於以下問題:Python turtle.circle方法的具體用法?Python turtle.circle怎麽 ...

  8. python中的画笔控制函数_Python turtle库的画笔控制说明

    turtle.penup() 别名 turtle.pu() :抬起画笔海龟在飞行 turtle.pendown() 别名 turtle.pd():画笔落下,海龟在爬行 turtle.pensize(w ...

  9. python画小猪乔治_Python turtle 学习笔记

    importturtle as t'''t.pu() 提起画笔 t.pd() 移动时绘制图形,缺省时也为绘制 t.seth 设置当前朝向为angle角度 t.begin_fill() 准备开始填充图形 ...

最新文章

  1. Flutter - International 国际化,Localization 本地化, 使用Intl
  2. 服务器配置tensorflow2.0.0的gpu环境,python3.7
  3. Intervals on the Ring 环状数轴区间-模数-构造-区间交并集
  4. angular6父子组件之间的引入报错
  5. 手淘促活那些事儿 | 智能投放算法框架助力用户增长
  6. swoole 捕捉php错误,swoole怎么处理错误
  7. 小米营销教父的滚烫十年
  8. 解决虚拟机上的tomcat无法被主机访问的问题
  9. lambdaQuery中EQ、NE、GT、LT、GE、LE的用法 (来自网络收集)
  10. 物联网操作系统再思考-共享心跳中心机制(SHBC)
  11. VS2015编译ffmpeg的问题解决
  12. 微运行库2015_vc++2015运行库下载_vc++2015运行库64位官方下载「vc2015」-太平洋下载中心...
  13. 如何查阅python的官方文档
  14. php输出cad文件,AutoCAD 二次开发 输出为WMF 或BMP文件
  15. [附源码]计算机毕业设计JAVAJAVA大方汽车租赁管理系统
  16. 谷歌浏览器flash插件离线下载,最新版
  17. c语言中布尔类型字节数,【C语言】中的布尔类型
  18. centos7 firewalld ip转发设置
  19. linux perl 升级,科学网—一次Perl版本升级引发的吐槽大会 - 黄健的博文
  20. STM32HAL库串口处理---中断收发

热门文章

  1. 怎样用C语言编写病毒(二)
  2. 微信拍一拍小尾巴生成源码
  3. oracle存储过程显示弹框,oracle存储过程异常信息的显示
  4. beego orm Error 1045 [ORM]2020/06/12 22:17:09 register db Ping `default`, Error 1045: Access denied
  5. 微信iOS7.0.9更新!除了朋友圈可以评论表情包,还有这些你可能不知道的功能!
  6. Java Android 根据银行卡号判断银行名称
  7. java毕业生设计兴澜幼儿园管理系统计算机源码+系统+mysql+调试部署+lw
  8. 运维知识-CentOS7-查看内存型号品牌等
  9. chocolatey的安装与使用与chocolatey安装失败的解决方法
  10. 【转】美国NASA致力研究超光速引擎,具备可能性