• python画冰墩墩


    今天已经到了2022北京冬奥闭幕的日子,然而我还没有属于自己的冰墩墩

    所以,赶紧来画一个吧

    import turtle as t
    
    t.Screen().title('冰墩墩')  # 窗口标题
    t.speed(0)  # 画笔速度-最快0~10
    
    # 头顶
    t.penup()
    t.goto(-73, 230)
    t.pencolor("lightgray")
    t.pensize(3)
    t.fillcolor("white")
    t.begin_fill()
    t.pendown()
    t.setheading(20)
    t.circle(-250, 35)
    # 左耳
    t.setheading(50)
    t.circle(-42, 180)
    # 左侧
    t.setheading(-50)
    t.circle(-190, 30)
    t.circle(-320, 45)
    # 左腿
    t.circle(120, 30)
    t.circle(200, 12)
    t.circle(-18, 85)
    t.circle(-180, 23)
    t.circle(-20, 110)
    t.circle(15, 115)
    t.circle(100, 12)
    # 右腿
    t.circle(15, 120)
    t.circle(-15, 110)
    t.circle(-150, 30)
    t.circle(-15, 70)
    t.circle(-150, 10)
    t.circle(200, 35)
    t.circle(-150, 20)
    # 右手
    t.setheading(-120)
    t.circle(50, 30)
    t.circle(-35, 200)
    t.circle(-300, 23)
    # 右侧
    t.setheading(86)
    t.circle(-300, 26)
    # 右耳
    t.setheading(122)
    t.circle(-53, 160)
    t.end_fill()
    # 右耳内侧
    t.penup()
    t.goto(-130, 180)
    t.pencolor("black")
    t.pensize(1)
    t.fillcolor("black")
    t.begin_fill()
    t.pendown()
    t.setheading(120)
    t.circle(-28, 160)
    t.setheading(210)
    t.circle(150, 20)
    t.end_fill()
    # 左耳内侧
    t.penup()
    t.goto(90, 230)
    t.setheading(40)
    t.begin_fill()
    t.pendown()
    t.circle(-30, 170)
    t.setheading(125)
    t.circle(150, 23)
    t.end_fill()
    # 右手内侧
    t.penup()
    t.goto(-180, -55)
    t.fillcolor("black")
    t.begin_fill()
    t.setheading(-120)
    t.pendown()
    t.circle(50, 30)
    t.circle(-27, 200)
    t.circle(-300, 20)
    t.setheading(-90)
    t.circle(300, 14)
    t.end_fill()
    # 左腿内侧
    t.penup()
    t.goto(108, -168)
    t.fillcolor("black")
    t.begin_fill()
    t.pendown()
    t.setheading(-115)
    t.circle(110, 15)
    t.circle(200, 10)
    t.circle(-18, 80)
    t.circle(-180, 13)
    t.circle(-20, 90)
    t.circle(15, 60)
    t.setheading(42)
    t.circle(-200, 29)
    t.end_fill()
    # 右腿内侧
    t.penup()
    t.goto(-38, -210)
    t.fillcolor("black")
    t.begin_fill()
    t.pendown()
    t.setheading(-155)
    t.circle(15, 100)
    t.circle(-10, 110)
    t.circle(-100, 30)
    t.circle(-15, 65)
    t.circle(-100, 10)
    t.circle(200, 15)
    t.setheading(-14)
    t.circle(-200, 27)
    t.end_fill()
    # 左手
    t.penup()
    t.goto(177, 112)
    t.pencolor("lightgray")
    t.pensize(3)
    t.fillcolor("white")
    t.begin_fill()
    t.pendown()
    t.setheading(80)
    t.circle(-45, 200)
    t.circle(-300, 23)
    t.end_fill()
    # 左手内侧
    t.penup()
    t.goto(182, 95)
    t.pencolor("black")
    t.pensize(1)
    t.fillcolor("black")
    t.begin_fill()
    t.setheading(95)
    t.pendown()
    t.circle(-37, 160)
    t.circle(-20, 50)
    t.circle(-200, 30)
    t.end_fill()
    # 右眼眼圈
    t.penup()
    t.goto(-64, 120)
    t.begin_fill()
    t.pendown()
    t.setheading(40)
    t.circle(-35, 152)
    t.circle(-100, 50)
    t.circle(-35, 130)
    t.circle(-100, 50)
    t.end_fill()
    # 右眼眼珠
    t.penup()
    t.goto(-47, 55)
    t.fillcolor("white")
    t.begin_fill()
    t.pendown()
    t.setheading(0)
    t.circle(25, 360)
    t.end_fill()
    t.penup()
    t.goto(-45, 62)
    t.pencolor("darkslategray")
    t.fillcolor("darkslategray")
    t.begin_fill()
    t.pendown()
    t.setheading(0)
    t.circle(19, 360)
    t.end_fill()
    t.penup()
    t.goto(-45, 68)
    t.fillcolor("black")
    t.begin_fill()
    t.pendown()
    t.setheading(0)
    t.circle(10, 360)
    t.end_fill()
    t.penup()
    t.goto(-47, 86)
    t.pencolor("white")
    t.fillcolor("white")
    t.begin_fill()
    t.pendown()
    t.setheading(0)
    t.circle(5, 360)
    t.end_fill()
    # 左眼眼圈
    t.penup()
    t.goto(51, 82)
    t.fillcolor("black")
    t.begin_fill()
    t.pendown()
    t.setheading(120)
    t.circle(-32, 152)
    t.circle(-100, 55)
    t.circle(-25, 120)
    t.circle(-120, 45)
    t.end_fill()
    # 左眼眼珠
    t.penup()
    t.goto(79, 60)
    t.fillcolor("white")
    t.begin_fill()
    t.pendown()
    t.setheading(0)
    t.circle(24, 360)
    t.end_fill()
    t.penup()
    t.goto(79, 64)
    t.pencolor("darkslategray")
    t.fillcolor("darkslategray")
    t.begin_fill()
    t.pendown()
    t.setheading(0)
    t.circle(19, 360)
    t.end_fill()
    t.penup()
    t.goto(79, 70)
    t.fillcolor("black")
    t.begin_fill()
    t.pendown()
    t.setheading(0)
    t.circle(10, 360)
    t.end_fill()
    t.penup()
    t.goto(79, 88)
    t.pencolor("white")
    t.fillcolor("white")
    t.begin_fill()
    t.pendown()
    t.setheading(0)
    t.circle(5, 360)
    t.end_fill()
    # 鼻子
    t.penup()
    t.goto(37, 80)
    t.fillcolor("black")
    t.begin_fill()
    t.pendown()
    t.circle(-8, 130)
    t.circle(-22, 100)
    t.circle(-8, 130)
    t.end_fill()
    # 嘴巴
    t.penup()
    t.goto(-15, 48)
    t.setheading(-36)
    t.begin_fill()
    t.pendown()
    t.circle(60, 70)
    t.setheading(-132)
    t.circle(-45, 100)
    t.end_fill()
    # 彩虹圈
    t.penup()
    t.goto(-135, 120)
    t.pensize(5)
    t.pencolor("cyan")
    t.pendown()
    t.setheading(60)
    t.circle(-165, 150)
    t.circle(-130, 78)
    t.circle(-250, 30)
    t.circle(-138, 105)
    t.penup()
    t.goto(-131, 116)
    t.pencolor("slateblue")
    t.pendown()
    t.setheading(60)
    t.circle(-160, 144)
    t.circle(-120, 78)
    t.circle(-242, 30)
    t.circle(-135, 105)
    t.penup()
    t.goto(-127, 112)
    t.pencolor("orangered")
    t.pendown()
    t.setheading(60)
    t.circle(-155, 136)
    t.circle(-116, 86)
    t.circle(-220, 30)
    t.circle(-134, 103)
    t.penup()
    t.goto(-123, 108)
    t.pencolor("gold")
    t.pendown()
    t.setheading(60)
    t.circle(-150, 136)
    t.circle(-104, 86)
    t.circle(-220, 30)
    t.circle(-126, 102)
    t.penup()
    t.goto(-120, 104)
    t.pencolor("greenyellow")
    t.pendown()
    t.setheading(60)
    t.circle(-145, 136)
    t.circle(-90, 83)
    t.circle(-220, 30)
    t.circle(-120, 100)
    t.penup()
    # 爱心
    t.penup()
    t.goto(220, 115)
    t.pencolor("brown")
    t.pensize(1)
    t.fillcolor("brown")
    t.begin_fill()
    t.pendown()
    t.setheading(36)
    t.circle(-8, 180)
    t.circle(-60, 24)
    t.setheading(110)
    t.circle(-60, 24)
    t.circle(-8, 180)
    t.end_fill()
    t.up()
    # BEIJING 2022
    t.pencolor("black")
    t.goto(-35, -160)
    t.write("BEIJING 2022", font=('Arial', 10, 'bold italic'))
    # 五环
    t.penup()
    t.goto(-25, -170)
    t.pendown()
    t.pencolor("blue")
    t.circle(6)
    t.penup()
    t.goto(-10, -170)
    t.pendown()
    t.pencolor("black")
    t.circle(6)
    t.penup()
    t.goto(5, -170)
    t.pendown()
    t.pencolor("brown")
    t.circle(6)
    t.penup()
    t.goto(-18, -175)
    t.pendown()
    t.pencolor("lightgoldenrod")
    t.circle(6)
    t.penup()
    t.goto(-4, -175)
    t.pendown()
    t.pencolor("green")
    t.circle(6)
    t.penup()
    t.hideturtle()
    t.done()

    成品:

  • 相关阅读:
    单 GPU 程序 转 多 GPU 程序
    Ubuntu 开启ssh 连接,设置静态 ip 地址。
    Ubuntu 添加新硬盘 之 分区+格式化+挂载
    夜间模式的开启与关闭,父模板的制作
    开始Flask项目
    完成登录与注册页面的前端
    JavaScript 基础,登录前端验证
    CSS实例:图片导航块
    导航,头部,CSS基础
    web基础,用html元素制作web页面
  • 原文地址:https://www.cnblogs.com/yinguojin/p/15914338.html
Copyright © 2020-2023  润新知