样式:

代码:

#-*- coding: UTF-8 -*-
import turtle as t# 设置背景颜色,窗口位置以及大小t.colormode(255)# 颜色模式
t.speed(0)
t.screensize(850,760,"white")#画布大小背景颜色
t.setup(width=850, height=760,startx=260, starty=0) #绘图窗口的大小和起始坐标
# t.bgpic("C:/Users/Angle/Desktop/1.gif")
t.title("专属XX的草莓熊!")#设置绘图窗口的标题
t.resizemode('noresize')  #大小调整模式:auto,user,noresize
t.tracer(1)   scolor=["#E6005C","#00BFFF","#538a30","#F28500"]   # 深色列表
qcolor=["#FF007F","#87CEFA","#7fbc2b","#FFA500"]  # 浅色列表
blsize=80                     # blsize值,blsize,是大等腰直角三角形的斜边风车等比例缩放
bs=2**0.5/2*blsize             # bs是直角边,2**0.5 表示数学中的“根号2”
# zjsjxxb是小等腰直角三角形的斜边,zjb是直角边
zjb=blsize/2 # zjb是小等腰直角三角形的直角边
zjsjxxb=2**0.5 *zjb  # zjsjxxb是小等腰直角三角形的斜边
length=1.7*blsize # 风车杆长
width=2/15*blsize # 风车杆宽def fongche():#风车 t.penup()t.goto(-205,-42)t.begin_fill()t.pensize(4)t.pencolor("#321320")t.fillcolor("#D2B48C")t.circle(15)t.end_fill()t.penup()t.goto(-220,80)t.pendown()t.setheading(-90)t.pensize(width)t.pencolor("#5f4a1d")t.forward(length)t.pensize(2)t.backward(length)t.setheading(90)for i in range(4):# 小等腰直角三角形t.color(scolor[i])  # 遍历深色列表scolort.begin_fill()t.forward(zjb)t.left(90)t.forward(zjb)t.left(135)t.forward(zjsjxxb)t.end_fill()#t.pencolor(scolor[i])#t.pensize(4)# 大等腰直角三角形t.color(qcolor[i])  # 遍历浅色列表qcolort.begin_fill()t.backward(zjsjxxb)t.right(90)t.forward(bs)t.left(135)t.forward(blsize)t.end_fill()#t.pencolor(scolor[i])#t.pensize(4)# 旋转180度后,画下一片风车叶片t.right(180)t.penup()mling_circle_list = iter([  # 每段弧线(半径,弧角度数)(18, 360), (14, 360), (10, 360), (6, 360),(18, 360), (14, 360), (10, 360), (6, 360),
])def mling_draw_eyeball(zb1,zb2,zb3,zb4):  for zb, color_ in zip([zb1,zb2,zb3,zb4], ['#ffffff', '#482d08', '#000000', '#ffffff']):t.penup()t.goto(*zb)t.pendown()t.begin_fill()t.setheading(0)t.color(color_)t.pencolor('#000000')t.pensize(2)t.circle(*next(mling_circle_list))t.end_fill()t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#cb3263")
t.pensize(4)
t.goto(120,110)
t.pendown()
t.begin_fill()
t.goto(200,0)
t.left(-40)
t.circle(-110,105)
t.left(75)
t.goto(170,-110)
t.left(-80)
t.circle(30,40)
t.left(60)
t.circle(-80,70)
t.left(83)
t.circle(-35,95)
t.goto(60,-270)
t.left(-80)
t.circle(-65,70)
t.left(63)
t.circle(35,30)
t.left(130)
t.circle(-65,70)
t.goto(-120,-270)
t.left(-110)
t.circle(-35,80)
t.left(83)
t.circle(-80,50)
t.left(60)
t.circle(-80,60)
t.left(60)
t.circle(30,30)
t.left(20)
t.circle(80,80)
t.left(-105)
t.circle(-70,150)
t.left(50)
t.circle(-170,50)
t.goto(120,110)
#Author:Adversity Awake
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#ffffff")
t.pensize(4)
t.goto(90,60)
t.pendown()
t.begin_fill()
t.right(30)
t.circle(-130,360)
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#f3d2ad")
t.pensize(4)
t.goto(-250,-55)
t.seth(0)
t.pendown()
t.begin_fill()
t.right(-55)
t.circle(-45,270)
t.goto(-220,-75)
t.goto(-250,-55)
t.end_fill()fongche()t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#f3d2ad")
t.pensize(4)
t.goto(185,-90)
t.pendown()
t.begin_fill()
t.right(140)
t.circle(43,95)
t.goto(185,-90)
t.end_fill()
t.penup()
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#cb3263')
t.pensize(4)
t.begin_fill()
t.goto(21,0)
t.pendown()
t.circle(123,134)
t.left(-90)
t.circle(40,185)
t.left(-60)
t.circle(120,60)
t.left(-90)
t.circle(50,200)
t.left(-90)
t.circle(100,100)
t.left(-12)
t.circle(100,40)
t.goto(21,0)
t.penup()
#Author:Adversity Awake
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.goto(-70,210)
t.left(140)
t.pendown()
t.circle(30,200)
t.goto(-70,210)
t.penup()
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.goto(90,220)
t.left(45)
t.pendown()
t.circle(22,200)
t.goto(90,220)
t.penup()
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#ffffff')
t.pensize(4)
t.begin_fill()
t.left(-98)
t.left(90)
t.goto(18,10)
t.pendown()
t.circle(100,134)
t.left(10)
t.circle(110,30)
t.left(10)
t.circle(160,40)
t.circle(85,40)
t.left(2)
t.circle(95,40)
t.left(5)
t.circle(95,60)
t.goto(18,10)
t.penup()
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(2)
t.goto(25,240)
t.pendown()
t.begin_fill()
t.goto(60,235)
t.left(30)
t.fd(8)
t.left(90)
t.fd(22)
t.circle(90, 8)
t.left(20)
t.circle(90, 8)
t.left(20)
t.circle(90, 20)
t.left(40)
t.circle(50, 20)
t.end_fill()
t.penup()
t.pensize(12)
t.goto(-2,250)
t.pencolor("#4D1F00")
t.fillcolor("#4D1F00")
t.pendown()
t.goto(60,240)
t.end_fill()
t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(2)
t.goto(-55,193)
t.pendown()
t.begin_fill()
t.left(65)
t.circle(-90, 25)
t.goto(-10,230)
t.left(30)
t.fd(8)
t.left(90)
t.fd(18)
t.circle(90, 8)
t.left(20)
t.circle(90, 10)
t.left(40)
t.circle(90, 30)
t.left(30)
t.circle(40, 20)
t.penup()
t.end_fill()
t.pensize(12)
t.goto(-63,195)
t.pencolor("#4D1F00")
t.fillcolor("#4D1F00")
t.pendown()
t.left(100)
t.circle(-85,45)
t.end_fill()mling_draw_eyeball((-20,180), (-23,185), (-25,188), (-30,200))
mling_draw_eyeball((30, 193), (27, 200), (25,203), (20,213)) t.penup()
p = t.home()
t.pencolor("#321320")
t.fillcolor("#8f3a52")
t.pensize(3)
t.goto(25,105)
p = t.pos()
t.pendown()
t.begin_fill()
t.circle(85, 65)
t.left(16)
t.circle(30, 55)
t.left(20)
t.circle(145, 58)
t.left(8)
t.circle(20, 55)
t.left(8)
t.circle(50, 65)
t.left(-5)
t.circle(310, 8)
t.end_fill()
t.penup()
t.goto(0, 0)
t.seth(0)
t.pencolor('#321320')
t.fillcolor('#a93e54')
t.pensize(3)
t.begin_fill()
t.left(-20)
t.goto(9,66)
t.pendown()
t.circle(68,40)
t.left(10)
t.circle(65,40)
t.left(160)
t.circle(-75,85)
t.left(158)
t.circle(48,37)
t.goto(9,66)
t.penup()
t.end_fill()
t.color('#321320')
t.penup()
t.goto(380,60)
t.pendown()
t.write("成\n功\n上\n岸\n一\n研\n为\n定\n",align="center",font=("黑体",20,"normal"))
t.penup()
t.goto(290,183)
t.pendown()
# t.write("成\n功\n上\n岸\n",align="center",font=("黑体",10,"normal"))
t.hideturtle()
# t.done()
t.fillcolor("red")
t.begin_fill()
t.circle(10, 180)
t.circle(25, 110)
t.left(50)
t.circle(60, 45)
t.circle(20, 170)
t.right(24)
t.fd(30)
t.left(-8)#原本是10
t.circle(30, 110)
t.fd(20)
t.left(40)
t.circle(90, 70)
t.circle(30, 150)
t.right(30)
t.fd(15)
t.circle(80, 90)
t.left(15)
t.fd(45)
t.right(165)
t.fd(20)
t.left(155)
t.circle(150, 80)
t.left(50)
t.circle(150, 90)
t.end_fill()# 花瓣1
t.left(150)
t.circle(-90, 70)
t.left(20)
t.circle(75, 105)
t.setheading(60)
t.circle(80, 98)
t.circle(-90, 40)# 花瓣2
t.left(180)
t.circle(90, 40)
t.circle(-80, 98)
t.setheading(-83)# 叶子1
t.fd(30)
t.left(90)
t.fd(25)
t.left(45)
t.fillcolor("green")
t.begin_fill()
t.circle(-80, 90)
t.right(90)
t.circle(-80, 90)
t.end_fill()
t.right(135)
t.fd(60)
t.left(180)
t.fd(85)
t.left(90)
t.fd(80)# 叶子2
t.right(90)
t.right(45)
t.fillcolor("green")
t.begin_fill()
t.circle(80, 90)
t.left(90)
t.circle(80, 90)
t.end_fill()
t.left(135)
t.fd(60)
t.left(180)
t.fd(60)
t.right(90)
t.circle(200, 60)t.done()

Python实现草莓熊手拿风车和鲜花相关推荐

  1. Python 小技之实现的鲜花盛宴,你准备好了吗?

    前言 本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:派森酱 PS:如有需要Python学习资料的小伙伴可以加点击下方链接 ...

  2. python绘制草莓熊

    import matplotlib.pyplot as plt import numpy as np# 绘制草莓熊的圆形身体 x, y = np.meshgrid(np.linspace(-1, 1, ...

  3. python毕业设计 基于django框架校园鲜花水果商城毕业设计设计与实现

    商城功能概要 首页.分类.商品详情页面,包含加入购物车.收藏商品.立即购买.用户登录.订单管理.地址管理:完整的购物流程,商品的加入.编辑.删除.批量选择,收货地址的选择,下单.会员中心(订单.收藏. ...

  4. Python画草莓熊

    文章目录 前言 一.草莓熊 总结 前言 今天,我们来画草莓熊. 一.草莓熊 草莓熊,英文名Lotso,迪士尼公司和皮克斯动画工作室公司于2010年合作推出的动画片<玩具总动员3>(Toy ...

  5. python制作旋转小风车

    import turtle as t t.goto(100,0) for i in range(100): t.left(80) t.fd(100) t.left(135) t.fd(165) t.l ...

  6. python第二周练习 风车

    import turtle as t t.pensize(10) t.pencolor("black") for i in range(4):t.seth(90*i)t.fd(15 ...

  7. py218-基于Python+django的鲜花销售商城网站#毕业设计

    开发语言:Python 编号:py218-基于Python+django的鲜花销售商城网站#毕业设计 python框架:django 软件版本:python3.7/python3.8 数据库:mysq ...

  8. Python基础知识详解

    函数可变参数 #可变参数允许你传入0个或任意个参数,这些可变参数在函数调用时自动组装为一个tuple. def calc(*number): sum = 0 for x in number: sum ...

  9. 10行python代码做出哪些酷炫的事情? 小白教程

    Python凭借其简洁的代码,赢得了许多开发者的喜爱.因此也就促使了更多开发者用Python开发新的模块,从而形成良性循环,Python可以凭借更加简短的代码实现许多有趣的操作.下面我们来看看,我们用 ...

  10. Python与爬虫有什么关系?Python为什么叫爬虫

    爬虫一般是指网络资源的抓取,由于Python的脚本特性,易于配置对字符的处理非常灵活,Python有丰富的网络抓取模块,因此两者经常联系在一起Python就被叫作爬虫.爬虫可以抓取某个网站或者某个应用 ...

最新文章

  1. 关于StartCoroutine的简单线程使用
  2. 一般web放在linux那个目录下,web.py应该安装在linux的哪个目录下?
  3. NYOJ【士兵杀敌(二)】
  4. 1119:矩阵交换行
  5. 灵活运用 SQL Server 数据库的 FOR XML PATH
  6. P2153-晨跑【费用流,网络流,拆点】
  7. jQuery数据表和Java集成
  8. Vue调试神器vue-devtools - 插件下载安装
  9. php修改隐藏域非法提交,PHP get、post变量放在表单隐藏域示例
  10. 守护线程C语言windows,C言语如何利用子线程刷新主线程
  11. 端口扫描 -- Masscan-Gui
  12. lbs mysql_使用mysql来实现lbs排序
  13. 学生如何提高专业英文阅读能力(转自施一公博客)
  14. linux下docker的使用教程,Linux中docker的使用方法讲解
  15. 拼多多“真香”补贴之变
  16. Opencv去除高光
  17. 联发科希望P40和P70救命,能如愿么?
  18. qrc路径_qrc 资源文件供外部使用的方法
  19. 12个很棒的学习 jQuery 的网站推荐
  20. 前端jquery实现商城sku效果

热门文章

  1. SDR HDR 动态范围
  2. 阿里达摩院/字节后端研发一面凉面经
  3. Windows优化大师域名解析问题
  4. 垃圾短信分类java_有了这个神器,快速告别垃圾短信邮件
  5. 育碧-彩虹六号如何绑定二次验证码/两步验证/身份验证?
  6. 半小时体验云原生:手把手教你在k8s上部署springboot应用——干货分享,建议收藏
  7. 美国亚马逊编辑推荐的一生必读书单100本
  8. C语言统计元音字母数量
  9. 树莓派4B:智能植物管家
  10. MySQL官方教程及各平台的安装教程和配置详解入口