python运用turtle库画图--关于疫情主题的图片

【Turtle系列】端正心态正确面对疫情,守护安全防线不放松,共抗疫情,只待春来~ 前言 ​​​​​​​​​​ ​ 今年3月份,​一场突如其来的“疫战”又一次打响。 在严峻的疫情之下,相信每个人也并未放松。面对疫情,足不出户,抗击疫情,不外出不聚 集,自觉为国家做贡献……宅在家要宅出健康,要宅出态度,宅出花样也要宅出精气神!接下来 跟小编一起为自己的家乡加油吧! 正文 这篇文章是绘制疫情期间,大家一起加油的画面!一方有难八方支援,全国人一起团结抗战, 只是绘制了部分的! 代码展示: ​ import turtle as t import random def wh 阅读详情

初学python中的turtle库,个人认为画图前要先建立好直角坐标系,确定好各主要点的坐标,这样提笔的时候更加容易画出准确的图。
使用turtle库画出了这样一张关于疫情主题的图片,寄托我们美好的祝愿。
在这里插入图片描述
代码如下:

import turtle as t
import random

def wheregoto(x,y): #x,y表示坐标
    t.up()
    t.goto(x,y)
    t.down()

t.speed(0)
t.pensize(4)
t.screensize(690,764) #设置画布
t.pensize(4)
wheregoto(-325,352)
t.setheading(270)
t.pencolor("gray1")
for j in range (2):
    t.forward(734)
    t.left(90)
    t.forward(650)
    t.left(90)
t.pencolor("red3")
t.penup()

#枕头
t.speed(0)
t.fillcolor("mint cream")
t.setheading(180)
wheregoto(-86,-22)
t.begin_fill()
t.pendown()
t.left(-10)
t.circle(160,12)
t.left(-41)
t.circle(60,10)
t.left(70)
t.circle(60,10)
t.left(40)
t.circle(200,8)
t.left(-8)
t.circle(200,4)
t.left(-18)
t.circle(200,4)
t.right(10)
t.circle(200,4)
t.left(10)
t.circle(200,4)
t.left(10)
t.circle(200,4)
t.left(10)
t.circle(200,3)
t.right(15)
t.circle(200,3)
t.right(25)
t.circle(200,3)
t.left(55)
t.circle(200,3)
t.left(25)
t.circle(200,14)
t.fd(150)
t.setheading(-5)
t.pendown()
t.circle(200,8)
t.right(40)
t.circle(200,2)
t.left(30)
t.circle(200,3)
t.left(20)
t.circle(200,2)
t.left(45)
t.circle(70,40)
t.right(30)
t.circle(200,17)
t.right(20)
t.circle(200,3)
t.left(10)
t.circle(200,3)
t.left(20)
t.circle(200,3)
t.left(20)
t.circle(60,3)
t.left(60)
t.circle(60,5)
t.left(20)
t.circle(60,5)
t.right(50)
t.circle(300,9)
t.seth(176)
t.fd(168)
t.end_fill()

#杯子
t.setheading(0)
wheregoto(-100,90)
t.fillcolor("floral white")
t.begin_fill()
t.left(-80)
t.forward(160)
t.left(30)
t.circle(100,95)
t.left(35)
t.forward(163)
t.end_fill()
t.fillcolor("khaki1")
t.begin_fill()
t.left(57)
t.circle(150,85)
t.left(103)
t.circle(180,68)
t.end_fill()

#面
#面底色
wheregoto(-86,81)
t.pencolor("red3")
t.fillcolor("khaki")
t.begin_fill()
t.setheading(56)
t.circle(-103,114)
t.pensize(2)
t.setheading(212)
t.circle(-154,70)
t.end_fill()

#大面
wheregoto(-76,78)
t.pencolor("Darkgoldenrod3")
t.setheading(36)
t.pensize(4)
t.circle(-140,70)
wheregoto(-76,90)#面条1
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.pensize(4)
t.circle(-160,50)
wheregoto(-54,110)#2
t.pencolor("Darkgoldenrod3")
t.setheading(18)
t.pensize(4)
t.circle(-150,50)
wheregoto(-36,115)#3
t.pencolor("Darkgoldenrod3")
t.setheading(19)
t.pensize(4)
t.circle(-90,60)
wheregoto(-36,115)#4
t.pencolor("Darkgoldenrod3")
t.setheading(24)
t.pensize(4)
t.circle(-90,60)
wheregoto(-66,75)#5
t.pencolor("Darkgoldenrod3")
t.setheading(41)
t.circle(-90,90)
wheregoto(-10,103)#6
t.pencolor("Darkgoldenrod3")
t.setheading(0)
t.circle(-110,47)
wheregoto(-10,103)#7
t.pencolor("Darkgoldenrod3")
t.setheading(0)
t.circle(-150,37)

#小面
t.pensize(5)
t.pencolor("red3")
wheregoto(-63,71)
t.setheading(39)
t.circle(-110,30)
t.setheading(10)
t.circle(-56,76)
wheregoto(-63,71)#面条1
t.pencolor("Darkgoldenrod3")
t.setheading(34)
t.circle(-110,30)
t.setheading(10)
t.circle(-56,72)
wheregoto(-54,67)#2
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.circle(-130,24)
t.setheading(6)
t.circle(-56,61)
wheregoto(-42,63)#3
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.circle(-130,20)
t.setheading(6)
t.circle(-56,52)
wheregoto(-28,60)#4
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.circle(-130,16)
t.setheading(6)
t.circle(-56,48)
wheregoto(-15,56)#5
t.pencolor("Darkgoldenrod3")
t.setheading(32)
t.circle(-130,14)
t.setheading(6)
t.circle(-40,48)
wheregoto(-1,56)#6
t.pencolor("Darkgoldenrod3")
t.setheading(34)
t.circle(-120,9)
t.setheading(6)
t.circle(-30,48)
wheregoto(13,56)#7
t.pencolor("Darkgoldenrod3")
t.setheading(30)
t.circle(-120,9)
t.setheading(6)
t.circle(-10,60)

#面轮廓
wheregoto(-86,81)
t.pencolor("red3")
t.setheading(56)
t.circle(-103,114)
t.pensize(4)
t.setheading(212)
t.circle(-154,70)

#酱汁
wheregoto(-34,110)
t.pensize(3)
t.pendown()
t.pencolor("orange4")
t.fillcolor("orange4")
t.begin_fill()
t.setheading(56)
t.circle(-40,50)
t.setheading(26)
t.circle(-40,70)
t.setheading(-15)
t.circle(-70,30)
t.circle(-30,30)
t.circle(-10,30)
t.circle(-10,100)
t.circle(-190,10)
t.circle(-5,360)
t.seth(-170)
t.circle(-180,20)
t.seth(145)
t.circle(-30,50)
t.end_fill()
t.penup()

wheregoto(55,75)
t.begin_fill()
t.circle(3,360)
t.end_fill()

wheregoto(40,90)
t.begin_fill()
t.circle(5,360)
t.end_fill()

wheregoto(-45,95)
t.begin_fill()
t.circle(2,360)
t.end_fill()

#葱
t.pencolor("lawn green")
t.fillcolor("lawn green")
wheregoto(0,110)
t.begin_fill()
t.circle(3,360,4)
t.end_fill()

t.pencolor("lawn green")
t.fillcolor("lawn green")
wheregoto(35,65)
t.begin_fill()
t.circle(2,360,4)
t.end_fill()

t.pencolor("DarkOliveGreen1")
t.fillcolor("DarkOliveGreen1")
wheregoto(45,90)
t.begin_fill()
t.circle(2,360,5)
t.end_fill()

t.pencolor("lawn green")
t.fillcolor("lawn green")
wheregoto(10,70)
t.begin_fill()
t.circle(2,360,5)
t.end_fill()

t.pencolor("DarkOliveGreen1")
t.fillcolor("DarkOliveGreen1")
wheregoto(-30,90)
t.begin_fill()
t.circle(3,360,5)
t.end_fill()

t.pencolor("lawn green")
t.fillcolor("lawn green")
wheregoto(-15,85)
t.begin_fill()
t.circle(2,360,4)
t.end_fill()

t.pencolor("lawn green")
t.fillcolor("lawn green")
wheregoto(15,80)
t.begin_fill()
t.circle(2,360,4)
t.end_fill()

t.pencolor("DarkOliveGreen1")
t.fillcolor("DarkOliveGreen1")
wheregoto(-35,70)
t.begin_fill()
t.circle(2,360,4)
t.end_fill()

t.pencolor("DarkOliveGreen1")
t.fillcolor("DarkOliveGreen1")
wheregoto(25,95)
t.begin_fill()
t.circle(3,360,4)
t.end_fill()

t.pencolor("DarkOliveGreen1")
t.fillcolor("DarkOliveGreen1")
wheregoto(70,85)
t.begin_fill()
t.circle(2,360,4)
t.end_fill()

t.pencolor("DarkOliveGreen1")
t.fillcolor("DarkOliveGreen1")
wheregoto(30,120)
t.begin_fill()
t.circle(3,360,4)
t.end_fill()

#辣椒
t.pensize(3)
t.pencolor("OrangeRed2")
t.fillcolor("OrangeRed2")
wheregoto(-15,120)
t.begin_fill()
t.circle(3,360,4)
t.end_fill()

wheregoto(19,78)
t.pensize(2)
t.pencolor("OrangeRed2")
t.fillcolor("OrangeRed2")
t.pendown()
t.begin_fill()
t.circle(-4,260)
t.end_fill()

wheregoto(20,80)
t.pensize(1)
t.pencolor("Salmon")
t.fillcolor("Salmon")
t.begin_fill()
t.seth(23)
t.circle(-3,360,4)
t.end_fill()

t.pensize(3)
t.pencolor("OrangeRed2")
t.fillcolor("OrangeRed2")
wheregoto(-15,85)
t.begin_fill()
t.circle(3,360,4)
t.end_fill()

wheregoto(55,100)
t.pensize(1)
t.pencolor("Salmon")
t.fillcolor("Salmon")
t.begin_fill()
t.seth(23)
t.circle(-3,360,4)
t.end_fill()

t.pensize(3)
t.pencolor("OrangeRed2")
t.fillcolor("OrangeRed2")
wheregoto(15,113)
t.begin_fill()
t.circle(5,360)
t.end_fill()

wheregoto(15,115)
t.pensize(1)
t.pencolor("Salmon")
t.fillcolor("Salmon")
t.begin_fill()
t.seth(23)
t.circle(3,360,4)
t.end_fill()

t.pensize(3)
t.pencolor("OrangeRed2")
t.fillcolor("OrangeRed2")
wheregoto(5,93)
t.begin_fill()
t.circle(3,360,6)
t.end_fill()

t.pencolor("OrangeRed2")
t.fillcolor("OrangeRed2")
wheregoto(38,99)
t.begin_fill()
t.circle(3,360,4)
t.end_fill()

t.pencolor("OrangeRed2")
t.fillcolor("OrangeRed2")
wheregoto(25,105)
t.begin_fill()
t.circle(3,360,4)
t.end_fill()

wheregoto(-10,70)
t.pensize(1)
t.pencolor("Salmon")
t.fillcolor("Salmon")
t.begin_fill()
t.seth(23)
t.circle(4,360,4)
t.end_fill()

wheregoto(32,105)
t.pensize(1)
t.pencolor("Salmon")
t.fillcolor("Salmon")
t.begin_fill()
t.seth(23)
t.circle(3,360)
t.end_fill()

#眼睛
t.speed(0)
t.pensize(1)
t.setheading(180)
t.fillcolor("red3")
t.begin_fill()
wheregoto(-25,37)
len = 0.12
for k in range(2):
    for j in range(60):
        if j < 30:
            len += 0.024
        else:
            len -= 0.024
        t.forward(len)
        t.left(3)
t.end_fill()
wheregoto(-28,31)
t.pencolor("snow")
t.fillcolor("snow")
t.begin_fill()
len = 0.05
for k in range(2):
    for j in range(60):
        if j < 30:
            len += 0.01
        else:
            len -= 0.01
        t.forward(len)
        t.left(3)
wheregoto(-24,22)
t.circle(2,360)
t.end_fill()

t.pencolor("red3")
t.fillcolor("red3")
t.begin_fill()
wheregoto(23,37)
len = 0.12
for k in range(2):
    for j in range(60):
        if j < 30:
            len += 0.024
        else:
            len -= 0.024
        t.forward(len)
        t.left(3)
t.end_fill()
wheregoto(20,31)
t.pencolor("snow")
t.fillcolor("snow")
t.begin_fill()
len = 0.05
for k in range(2):
    for j in range(60):
        if j < 30:
            len += 0.01
        else:
            len -= 0.01
        t.forward(len)
        t.left(3)
wheregoto(24,22)
t.circle(2,360)
t.end_fill()

#腮红
t.pensize(4)
t.pencolor("salmon1")
t.fillcolor("salmon1")
t.begin_fill()
wheregoto(-40,13)
t.setheading(90)
len = 0.16
for k in range(2):
    for j in range(60):
        if j < 30:
            len += 0.032
        else:
            len -= 0.032
        t.forward(len)
        t.left(3)
t.end_fill()
t.begin_fill()
wheregoto(62,14)
t.setheading(90)
len = 0.16
for k in range(2):
    for j in range(60):
        if j < 30:
            len += 0.032
        else:
            len -= 0.032
        t.forward(len)
        t.left(3)
t.end_fill()

t.pensize(2)
t.pencolor("red3")
wheregoto(-65,16)
t.setheading(0)
t.right(55)
t.forward(10)
wheregoto(-56,19)
t.forward(11)
wheregoto(-48,19)
t.forward(10)

wheregoto(37,17)
t.forward(10)
wheregoto(44,19)
t.forward(11)
wheregoto(53,18)
t.forward(10)

#口罩
t.pensize(4)
t.setheading(0)
wheregoto(-87,16)
t.left(-42)
t.circle(100,21)
t.fillcolor("LightBlue1")
t.begin_fill()
t.left(-80)
t.circle(100,39)
t.left(30)
t.circle(95,56)
t.left(35)
t.circle(100,43)
t.left(50)
t.circle(120,55)
t.end_fill()

t.setheading(0)
wheregoto(-71,-66)
t.left(-2)
t.circle(100,13)
wheregoto(86,11)
t.left(180)
t.circle(100,19)

wheregoto(74,-72)
t.right(40)
t.circle(100,16)

#衣服
t.fillcolor("alice blue")
t.pensize(4)
t.setheading(0)
wheregoto(78,-193)
t.begin_fill()
t.left(90)
t.circle(150,31)
t.left(28)
t.circle(750,2)
t.left(75)       #领子
t.circle(100,20)
t.right(120)
t.circle(100,13)
t.left(80)
t.circle(100,13)
t.right(130)
t.circle(105,20)
t.left(75)
t.circle(720,2)
t.left(40)
t.circle(150,34)
t.seth(7)
t.circle(-480,18)
t.end_fill()

wheregoto(-43,-140)
t.right(90)
t.circle(180,13)
wheregoto(5,-140)
t.right(10)
t.circle(180,16)
wheregoto(53,-150)
t.right(10)
t.circle(170,14)

wheregoto(-40,-155)
t.setheading(0)
t.right(80)
t.forward(5)
wheregoto(-34,-155)
t.setheading(0)
t.right(80)
t.forward(5)

wheregoto(-31,-99)
t.setheading(0)
t.right(35)
t.circle(100,20)
t.left(27)
t.circle(100,20)

#被子
t.setheading(0)
wheregoto(160,-245)
t.left(100)
t.circle(100,25)
t.left(45)
t.circle(1000,15)
t.left(10)
t.circle(20,30)
t.right(90)
t.circle(20,30)
t.setheading(180)
t.circle(10,60)
t.circle(130,21)

wheregoto(-110,-200)
t.setheading(0)
t.right(150)
t.forward(25)
wheregoto(-90,-200)
t.setheading(0)
t.right(150)
t.forward(25)

wheregoto(-76,-189)
t.pensize(2)
t.seth(5)
t.circle(-480,18)
t.seth(-6)
t.fd(45)

#黑龙江
#大米
t.pensize(4)
t.speed(0)
wheregoto(-265,190)
t.seth(-80)
t.fillcolor("lemon chiffon")
t.begin_fill()
t.fd(60)
wheregoto(-256,140)
t.seth(-88)
t.fd(50)
wheregoto(-265,190)#上横1
t.seth(15)
t.fd(60)
wheregoto(-205,206)#上横2
t.seth(0)
t.fd(59)
wheregoto(-147,206)#右竖1
t.seth(-82)
t.fd(60)
wheregoto(-140,163)#右竖2
t.seth(-87)
t.fd(110)
wheregoto(-134,50)#下横
t.seth(-178)
t.fd(110)
t.end_fill()
t.penup()

#右手
wheregoto(-324,90)#右手手臂第一条线
t.seth(-5)
t.fillcolor("seashell")
t.begin_fill()
t.fd(60)
wheregoto(-264,86)#右手拇指第一条线
t.seth(15)
t.fd(40)
wheregoto(-224,93)#右手拇指第二条线
t.seth(-120)
t.fd(20)
wheregoto(-234,75)#右手食指
t.seth(-11)
t.fd(48)
wheregoto(-187,65)#右手食指第二条线
t.seth(-170)
t.fd(22)
wheregoto(-207,60)#右手中指第1条线
t.seth(-8)
t.fd(18)
wheregoto(-190,55)#右手中指第2条线
t.seth(-172)
t.fd(16)
wheregoto(-207,51)#右手小指第1条线
t.seth(-8)
t.fd(16)
wheregoto(-190,46)#右手小指第2条线
t.seth(-172)
t.fd(48)
wheregoto(-234,39.5)#右手手臂
t.seth(172)
t.fd(90)
t.end_fill()

#左手手臂
wheregoto(-324,90)#右手手臂第一条线
t.seth(-5)
t.fillcolor("seashell")
t.begin_fill()
t.fd(60)
t.seth(15)
t.fd(8)
t.left(74)
t.fd(27)
t.end_fill()
t.begin_fill()
wheregoto(-324,90)
wheregoto(-324,120)
t.seth(-5)
t.fd(70)
t.end_fill()

#"米"
t.pensize(5)
wheregoto(-218,154)#捺点
t.seth(-46)
t.fd(20)
t.pensize(5)
wheregoto(-190,163)#撇点
t.seth(-108)
t.fd(20)
t.pensize(6)
wheregoto(-215,130)#横
t.seth(16)
t.fd(35)
t.pensize(6)
wheregoto(-208,165)#竖
t.seth(-64)
t.circle(-140,28)
t.pensize(6)
wheregoto(-200,130)#撇
t.seth(-120)
t.fd(30)
t.pensize(6)
wheregoto(-196,133)
t.seth(-43)
t.fd(30)
wheregoto(-316,20)
t.pencolor("Orange Red2")
t.write("黑龙江",False,align="left",font=("华文彩云",18,"normal"))

#云南
t.pensize(4)
t.pencolor("red3")

#西瓜
wheregoto(-286,-147)
t.pensize(3)
t.fillcolor("chartreuse3")
t.begin_fill()
t.circle(80,360)
t.end_fill()
wheregoto(-286,-30)
t.setheading(30)
t.fillcolor("green4")
t.begin_fill()
t.circle(-85,135)
t.setheading(116)
t.circle(170,55)
t.end_fill()

wheregoto(-291,-35)
t.setheading(-20)
t.fillcolor("green4")
t.begin_fill()
t.circle(-190,49)
t.setheading(163)
t.circle(-180,51)
t.end_fill()
wheregoto(-296,-42)
t.setheading(-88)
t.fillcolor("green4")
t.begin_fill()
t.circle(115,85)
t.setheading(200)
t.circle(-85,125)
t.end_fill()

#瓜柄
wheregoto(-294,-38)
t.speed(1)
t.seth(150)
t.circle(-31,90)
t.circle(-9,148)
t.circle(-70,10)
t.circle(-40,70)
#左手
t.speed(0)
t.pencolor("red3")
wheregoto(-326,-162)#左手
t.fillcolor("seashell")
t.seth(30)
t.fd(38)
#右手
t.begin_fill()
wheregoto(-324,-162)
wheregoto(-324,-200)#右手第一条线
t.seth(30)
t.fd(70)
t.end_fill()
t.fd(10)
t.seth(65)#右手拇指
t.begin_fill()
t.fd(32)
t.circle(-8,90)
t.circle(-7,60)
t.circle(20,40)
t.seth(20)#食指
t.fd(41)
t.circle(-10,80)
t.seth(-140)
t.fd(37)
t.seth(35)#中指
t.fd(20)
t.pensize(4)
t.circle(-3,150)
t.seth(-140)
t.fd(18)
t.pensize(3.5)#小指
t.seth(30)
t.fd(11)
t.circle(-3,150)
t.seth(-150)
t.fd(42)
t.seth(-138)#右手手臂第二条线
t.fd(148)
wheregoto(-324,-202)
t.end_fill()
wheregoto(-314,-235)
t.pencolor("Orange Red2")
t.write("云南",False,align="left",font=("华文彩云",20,"normal"))

#瓜柄
wheregoto(-294,-38)
t.speed(1)
t.seth(150)
t.circle(-31,90)
t.circle(-9,148)
t.circle(-70,10)
t.circle(-40,70)
#左手
t.speed(0)
t.pencolor("red3")
wheregoto(-326,-162)#左手
t.fillcolor("seashell")
t.seth(30)
t.fd(38)
#右手
t.begin_fill()
wheregoto(-324,-162)
wheregoto(-324,-200)#右手第一条线
t.seth(30)
t.fd(70)
t.end_fill()
t.fd(10)
t.seth(65)#右手拇指
t.begin_fill()
t.fd(32)
t.circle(-8,90)
t.circle(-7,60)
t.circle(20,40)
t.seth(20)#食指
t.fd(41)
t.circle(-10,80)
t.seth(-140)
t.fd(37)
t.seth(35)#中指
t.fd(20)
t.pensize(4)
t.circle(-3,150)
t.seth(-140)
t.fd(18)
t.pensize(3.5)#小指
t.seth(30)
t.fd(11)
t.circle(-3,150)
t.seth(-150)
t.fd(42)
t.seth(-138)#右手手臂第二条线
t.fd(148)
wheregoto(-324,-202)
t.end_fill()
wheregoto(-314,-235)
t.pencolor("Orange Red2")
t.write("云南",False,align="left",font=("华文彩云",20,"normal"))
#鱼 胳膊上色
t.pencolor("seashell")
wheregoto(-143,344)
t.fillcolor("seashell")
t.setheading(-70)
t.begin_fill()
t.fd(32)
t.setheading(-60)
t.fd(65)
wheregoto(-75,276)
t.setheading(107)
t.fd(86)
t.end_fill()

t.pencolor("seashell")
wheregoto(-25,348)
t.setheading(90)
t.fillcolor("seashell")
t.begin_fill()
t.backward(80)
t.setheading(-5)
t.fd(30)
t.setheading(-90)
t.goto(20,347)
t.end_fill()

#鱼 胳膊
wheregoto(-190,300)
t.pencolor("Orange Red2")
t.write("福建",False,align="left",font=("华文彩云",20,"normal"))
t.pencolor("red3")
wheregoto(-143,348)
t.setheading(-70)
t.fd(32)
t.setheading(-60)
t.fd(65)

wheregoto(-95,348)
t.setheading(-73)
t.fd(85)
t.pencolor("red3")
wheregoto(-25,348)
t.setheading(-90)
t.fd(80)
wheregoto(20,348)
t.circle(-170,20)
t.fd(22)

# 鱼
t.setheading(20)
wheregoto(-110,267)
t.fillcolor('#EEEEEe')
t.begin_fill()
t.circle(-220,40)
t.setheading(-15)
t.circle(5,70)
t.fd(30)
t.setheading(-75)
t.fd(50)
t.setheading(170)
t.fd(28)

t.setheading(200)
wheregoto(-110,267)
t.circle(100,30)
t.setheading(-20)
t.fd(10)
t.setheading(-130)
t.fd(13)
t.setheading(-35)
t.circle(150,85)
t.end_fill()

t.setheading(-60)
wheregoto(-110,267)
t.circle(-70,55)
wheregoto(-122,235)
t.dot(10)
# 鱼鳍
wheregoto(-90,240)
t.seth(-180)
t.circle(5,190)
t.setheading(30)
t.fd(15)

wheregoto(-75,277)
t.fillcolor('#EEEEEe')
t.begin_fill()
t.setheading(35)
t.fd(35)
t.setheading(-100)
t.fd(15)
t.end_fill()

wheregoto(-75,197)
t.fillcolor('#EEEEEe')
t.begin_fill()
t.setheading(-20)
t.fd(35)
t.setheading(110)
t.fd(14)
t.end_fill()

# 鱼 细节
t.pencolor('#bebebe')
wheregoto(-60,265)
t.setheading(10)
t.circle(-7,180)
t.setheading(10)
t.circle(-7,180)
t.setheading(10)
t.circle(-7,180)
t.setheading(10)
t.circle(-7,180)
wheregoto(-40,272)
t.setheading(10)
t.circle(-8,180)
t.setheading(10)
t.circle(-9,180)
t.setheading(10)
t.circle(-8,180)
t.setheading(10)
t.circle(-7,180)
wheregoto(-18,265)
t.setheading(10)
t.circle(-7,180)
t.setheading(10)
t.circle(-7,180)
t.setheading(10)
t.circle(-7,180)
wheregoto(5,260)
t.setheading(10)
t.circle(-6,180)
t.setheading(10)
t.circle(-6,180)
wheregoto(23,258)
t.setheading(10)
t.circle(-8,180)
wheregoto(54,265)
t.pensize(6)
t.setheading(50)
t.fd(13)
wheregoto(56,258)
t.pensize(6)
t.setheading(20)
t.fd(10)

#肉
wheregoto(230,310)
t.pencolor("Orange Red2")
t.write("内蒙古",False,align="left",font=("华文彩云",20,"normal"))
t.pencolor('red3')

wheregoto(235,290)
t.fillcolor('#ffded9')
t.begin_fill()
t.setheading(125)
t.fd(20)
t.circle(17,50)
t.circle(10,40)
t.setheading(200)
t.fd(5)
t.setheading(210)
t.fd(15)
t.setheading(215)
t.fd(10)
t.setheading(220)
t.fd(5)
t.circle(-60,50)
t.circle(-30,20)
t.setheading(165)
t.circle(10,30)
t.setheading(205)
t.circle(5,50)
t.setheading(-100)
t.fd(10)
t.setheading(-100)
t.circle(60,25)
t.setheading(-60)
t.circle(55,92)
t.goto(235,260)
t.end_fill()

t.pencolor('#f97a82')
t.fillcolor('#f97a82')
t.begin_fill()
wheregoto(110,263)
t.setheading(-85)
t.fd(17)
t.setheading(-60)
t.circle(45,50)
t.circle(70,30)
t.end_fill()

t.pencolor('#ffded9')
wheregoto(110,270)
t.fillcolor('#ffded9')
t.begin_fill()
t.setheading(-50)
t.circle(70,90)
t.end_fill()

t.pencolor('red3')
wheregoto(120,260)
t.setheading(-48)
t.circle(50,80)

# 肉手
wheregoto(280,310)
t.fillcolor('seashell')
t.begin_fill()
t.setheading(205)
t.fd(50)
t.setheading(140)
t.circle(15,-90)
wheregoto(320,300)
t.end_fill()
t.begin_fill()
t.setheading(200)
t.fd(90)
t.setheading(190)
t.fd(10)
t.setheading(185)
t.fd(10)
t.setheading(180)
t.fd(5)
t.setheading(225)
t.fd(5)
t.setheading(-50)
t.fd(10)
t.setheading(212)
t.fd(28)
t.setheading(-100)
t.fd(3)
t.setheading(-45)
t.fd(3)
t.setheading(15)
t.fd(20)
t.setheading(200)
t.fd(10)
t.setheading(-100)
t.fd(4)
t.setheading(-45)
t.fd(4)
t.setheading(18)
t.fd(20)
t.setheading(200)
t.fd(10)
t.setheading(-100)
t.fd(4)
t.setheading(-45)
t.fd(4)
t.setheading(18)
t.fd(25)
t.setheading(13)
t.fd(50)
t.setheading(19)
t.fd(38)
t.end_fill()

#饼
t.speed(0)
t.pencolor("red3")
wheregoto(140,140)
t.fillcolor("sandy brown") #第二块饼
t.begin_fill()
t.seth(-135)
t.circle(40,110)
t.seth(-20)
t.fd(43)
t.seth(0)
t.circle(60,30)
t.end_fill()
wheregoto(250,100)
t.seth(45)
t.fillcolor("orange") #第一块饼
t.begin_fill()
t.circle(35,45)
t.seth(115)
t.circle(30,30)
t.seth(155)
t.fd(60)
t.circle(40,145)
t.circle(65,70)
t.end_fill()
wheregoto(147,135)
t.pensize(3)
t.seth(-90)
t.circle(35,45)
wheregoto(167,100)
t.pensize(3)
t.seth(-45)
t.circle(42,52)
#小红点
for i in range(14):
    wheregoto(random.randint(150,255), random.randint(113,139))
    t.pencolor("red3")
    t.circle(1.5)
#手
t.pensize(4)
t.pencolor("red3")
wheregoto(320,140)
t.seth(-165)
t.fillcolor("seashell")
t.begin_fill()
t.fd(60)
wheregoto(260,100)
wheregoto(320,105)
t.seth(-175)
t.fd(60)
t.circle(-30,40)
t.seth(-145)
t.circle(7,25)
t.circle(9,80)
t.right(125)
t.circle(100,17)
t.circle(2,180)
t.seth(-18)
t.circle(100,10)
t.circle(-2,180)
t.seth(-170)
t.fd(11)
t.circle(2,180)
t.seth(-5)
t.circle(-60,10)
t.seth(-90)
t.circle(5,90)
t.seth(8)
t.fd(20)
wheregoto(260,45)
t.pencolor("Orange Red2")
t.write("新疆",False,align="left",font=("华文彩云",20,"normal"))
t.pencolor("red3")
wheregoto(311,67)
t.fd(10)
t.end_fill()

#山东
t.seth(-90)
wheregoto(320,-100)
t.fillcolor("seashell")
t.begin_fill()
t.right(100)
t.forward(40)
wheregoto(272,-118)
wheregoto(320,-130)
t.right(4)
t.forward(22)
t.circle(-220,9)
t.circle(-100,10)
t.right(15)
t.forward(18)#大拇指
t.seth(-90)
t.circle(-40,20)
t.circle(-21,50)#手窝
t.seth(172)#食指方向
t.fd(30)
t.circle(2,170)#食指的弧度
t.forward(26)#食指的长度
t.left(10)
t.bk(20)
t.seth(270)
t.circle(5,65)
t.forward(19)
t.left(13)
t.bk(9)
t.seth(270)
t.circle(5,79)
t.forward(30)
t.right(18)
t.circle(179,26)
t.end_fill()
wheregoto(250,-180)
t.pencolor("Orange Red2")
t.write("山东",False,align="left",font=("华文彩云",20,"normal"))
t.pencolor("red3")
wheregoto(240,-90)

#蘑菇伞
wheregoto(213,-45)
t.seth(70)
t.fillcolor("sandy brown")
t.begin_fill()
t.circle(-80,17)
t.circle(-10,95)
t.circle(-50,31)
t.end_fill()
wheregoto(240,-76)
t.seth(30)
t.begin_fill()
t.circle(109,20)
t.circle(4,80)
t.seth(173)
t.circle(-39,40)
t.circle(6,82)
t.circle(12,85)
t.end_fill()

#蘑菇梗
wheregoto(272,-100)
t.seth(30)
t.fillcolor("gold")
t.begin_fill()
t.circle(40,21)
t.seth(88)
t.circle(20,28)
t.seth(158)
t.circle(-40,39)
wheregoto(250,-72)
t.seth(-76)
t.circle(120,7)
t.end_fill()

#菜叶
t.fillcolor("lawn green")
def halfcircle(degree,radius,radian): #degree表示角度,radius表示半径,radian表示弧度
    t.seth(degree)
    t.circle(radius,radian)
wheregoto(190,-115)
t.begin_fill()
halfcircle(30,23,-100)
halfcircle(10,18,-110)
t.bk(13)
halfcircle(148,-18,160)
wheregoto(155,-48)
halfcircle(100,-25,60)
halfcircle(35,-15,70)
t.fd(10)
halfcircle(-5,-10,40)
halfcircle(-10,-10,30)
halfcircle(10,-15,70)
halfcircle(0,-20,90)
halfcircle(-70,-30,30)
t.end_fill()

wheregoto(241,-91)
t.begin_fill()
halfcircle(100,20,60)
halfcircle(90,25,90)
halfcircle(125,15,100)
halfcircle(135,18,180)
halfcircle(-90,20,90)
halfcircle(-104,20,30)
halfcircle(-40,30,40)

t.seth(-90)
wheregoto(240,-92)
t.circle(-40,17)
t.circle(-21,50)#手窝
t.seth(172)#食指方向
t.fd(32)
t.end_fill()

#菜心
wheregoto(227,-105)
t.fillcolor("white")
t.begin_fill()
t.seth(150)
t.circle(-100,20)
t.circle(-3,120)
t.seth(-25)
t.fd(41)
t.end_fill()
t.seth(13)
t.circle(-22,100)
t.seth(55)
t.circle(20,100)
t.seth(167)
t.fd(18)

#叶脉
def line(x,y,degree,length): #x,y表示坐标,degree表示角度,length表示前进距离
    wheregoto(x,y)
    t.seth(degree)
    t.fd(length)
line(215,-100,-150,8)
line(205,-90,-160,15)
line(197,-80,155,25)
line(206,-77,105,15)
line(220,-83,93,12)
line(171,-42,120,10)
line(186,-42,100,8)
line(206,-50,100,7)

t.pensize(4)
wheregoto(-325,352)
t.setheading(270)
t.pencolor("gray1")
for j in range (2):
    t.forward(734)
    t.left(90)
    t.forward(650)
    t.left(90)
t.pencolor("red3")
t.penup()

#文字
t.hideturtle()
t.pencolor("orangered3")
t.penup()
t.goto(190,-320)
t.write("热干面加油!", align="right", font=("楷体", 54, "normal"))
t.done()
Python画樱花树源代码,python3.7代码画樱花 如果觉得不过瘾,先想自己亲自做樱花效果,那么赶紧来看了,各式各样的樱花效果树,领域IT界樱花盛景,下面就分享一下好看好玩的樱花效果树代码,这些大多都是运用python中的海龟画图来实现出来的效果,有兴趣的小伙伴可以自己尝试,画出属于自己的那一片樱花!以下代码均是动态生成,不是图片。每到樱花盛开的时候,樱花花瓣一片一片如雪花般落下,远远望去,白嫩粉嫩的色彩大片大片。由于疫情原因,不能聚集游玩,如今春天到来,武大的樱花已经盛开了,所以很多平台都开通了线上赏樱花,跟随镜头带你云上赏樱花! 阅读详情

相关推荐

python代码画樱花怎么运行,python代码画樱花源代码

如果觉得不过瘾,先想自己亲自做樱花效果,那么赶紧来看了,各式各样的樱花效果树,领域IT界樱花盛景,下面就分享一下好看好玩的樱花效果树代码,这些大多都是运用python中的海龟画图来实现出来的效果,有兴趣的小伙伴可以自己尝试,画出属于自己的那一片樱花!以下代码均是动态生成,不是图片。每到樱花盛开的时候,樱花花瓣一片一片如雪花般落下,远远望去,白嫩粉嫩的色彩大片大片。由于疫情原因,不能聚集游玩,如今春天到来,武大的樱花已经盛开了,所以很多平台都开通了线上赏樱花,跟随镜头带你云上赏樱花!

K12345611717的博客 230

turtle库的图形绘制——紫荆花和黄花菜花

本篇介绍用四段圆弧艺术性简化花瓣绘制,将绘制花 的程序设计为函数,设计花瓣参数为变量,变量R控制花的大小、draw_color控制线条颜色、fill_color控制填充颜色、n控制花瓣数。 通过变量设置可绘制五瓣的紫荆花和六瓣的黄花菜花。

hz_zhangrl的博客 1501

用python中的turtle库绘制一些有趣的图

python画有趣的图

阿黎逸阳的博客 1万+

Python基础04 turtle库绘图

python基础语法turtle库的基础方法的总结以及函数的使用,参数的介绍等基础知识,希望对大家有所帮助。

Wantfly9951的博客 2507

利用Python的turtle模块绘制出一个在国旗下逆行的大白志愿者。

我们生在国旗下,活在春风里,疫情的突然来临,让我们不知所措,大白的迎难而上让我们战胜疫情的路上备受鼓舞,在此让我们向奋战在抗疫一线的医护人员和志愿者致敬。愿疫情早日结束,所有的医护人员和奋战在抗疫一线的志愿者都平平安安,健康喜乐。

详解!用python的pyecharts模块绘制世界地图(疫情)

pyecharts可视化疫情确诊人数世界地图 首先,我们需要进行环境的配置:python版本需要3.6.x ,pyecharts版本1.x 使用pip自动安装最新版本(这里的版本是1.7.1) 记得下载配套资源!!! pip install pyecharts pyecharts1.x之后,pyecharts 将不再自带地图 js 文件。用户需要自行安装对应的地图文件包。 地图文件被分成了三个 Python 包,分别为: 全球国家地图: echarts-countries-pypkg 中国省级地图: echarts-china-provinces-pypkg 中国市级地图: echarts

Python绘图应用--turtle库的使用

turtle库的基本操作

r1832644594的博客 3139

ThingsBoard - 设备接入

设备接入笔记

qq_53839898的博客 1464

【程序人生】卡塔尔世界杯元素python海龟绘图(附源代码),世界杯主题前端特效5个(附源码)

一、python turtle海龟绘图卡塔尔世界杯元素(1)、世界杯元素绘制效果图(2)、代码演示方法和代码命令解释(3)、本机运行、将绘图动画打包发给别人 (4)、完整源代码二、世界杯主题网页特效(1)、为透明png图片添加阴影特效 (2)、css三维空间移动特效(3)、css滤镜发光按钮(4)、翻转卡片特效 (5)、不停弹跳的旋转足球(带红色光影)

逆境清醒的博客 5438

VCSA的vmware-updatemgr服务无法启动和vSAN界面报“certificate chain is not trusted and thumbprint doesn‘t match”处理

"Unable to update CM service info"和"Server certificate chain is not trusted and thumbprint doesn't match"问题处理

jetliu05的博客 1894

FPGA资料分享——FPGA开发板入手指南

FPGA学习,开发板怎么选,看这里,就一个通透

weixin_51627076的博客 7315

【整活】使用海龟画图画一个绿码

python【整活】使用海龟画图画一个绿码

qq_61026911的博客 1161

CCS20实战入门:第一个工程搭建示例

通过实际操作演示如何在ccs20中创建并配置首个开发项目,涵盖环境设置与基础调试步骤,帮助新手快速上手ccs20集成开发环境,提升嵌入式开发效率。

weixin_31185473的博客 898

python画曲线图-python画曲线

广告关闭腾讯云双11爆品提前享,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高满返5000元!桃心形曲线的方程如下 matlab绘制效果如下:? matlab程序如下。 clccleart = -10:0.01:10x = 16*(sin(t)). ^3y = 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)%ylim()%xlim()grid ...

q6q6q的专栏 7605

LLM大模型基础知识【一】

大语言模型(LLM):是指在自然语言处理(Natural Language Processing,NLP)领域中的一类大模型,通常用于处理文本数据和理解自然语言。这类大模型的主要特点是它们在大规模语料库上进行了训练,以学习自然语言的各种语法、语义和语境规则。例如:GPT系列(OpenAI)、Bard(Google)、文心一言(百度)。视觉大模型:是指在计算机视觉(Computer Vision,CV)领域中使用的大模型,通常用于图像处理和分析。

lin_xi_xi的博客 2899

微信小程序 - 最新实现项目适老化设计全流程及源码,老年模式大字版与常规版页面样式切换,老年人大字模式字体与布局更换关怀版解决方案(新老项目均适用的方案,全局页面统一修改文本字号/DOM排版元素等)

微信小程序,vue2,vue3,老年大字版设计,小程序开发如何实现适老化方案,放大字体字号及改变页面的布局,小程序关怀模式实现思路及代码,统一将布局都改了,全局修改字体大小适配老年人看不清问题,小程序怎么接入老年模式并根据模式改变页面的UI设计,实现全局修改字体大小适老化/关怀版改造,最新详细示例代码全流程,字体放大/缩小,老项目怎么适配老年人模式方案,小程序适老化设计指南,当切换成老年模式时页面所有排版都会发生变化,小程序vue开发,新手详细教程,老年模式字体设置思路和UI布局的设计,开发者可以通过wx.

🏆 前端领域优质创作者 7325

给静态图片添加动态效果

2020庚子年,天干地支纪年第37位;一次大疫情举国哗。平白的多了近10日的假期,习惯上班下班的程序猿类居然开始有些不习惯无所事事,没有指令的工作节奏。 闲来无事难得可以连上网络,索性找些事情做做,以了却无聊乏味。下文给各位看官介绍python中两个工具包的妙用:pygame、pyturtle。 做游戏和幼儿编程的同学对这两个包,应该不陌生。pyturtle可以用来画图。 Turtle的前身是...

liangwqi的博客 5811

python基础:工作会用到的90%的python代码都在这了(万字详解!)

Python 备忘单是 Python 3 编程语言的单页参考表 著名的“Hello World”程序在 Python 中的实现 Python 不能在没有赋值的情况下声明变量 变量可以存放不同类型的值 内置数据类型 序列指一批有序的元素,集合指一批无序且不重复的元素查看: 数据类型 查看: 字符串 查看: 列表 查看: 判断 查看: 循环 查看: 函数 查看: 文件处理 表示 x 和 y 的商, 表示 x 和 y 的底商,另见 StackOverflow f-字符串 (Python 3.6+) 查看

数据知道的博客 1万+

python代码画樱花代码,python代码画樱花简单

如果觉得不过瘾,先想自己亲自做樱花效果,那么赶紧来看了,各式各样的樱花效果树,领域IT界樱花盛景,下面就分享一下好看好玩的樱花效果树代码,这些大多都是运用python中的海龟画图来实现出来的效果,有兴趣的小伙伴可以自己尝试,画出属于自己的那一片樱花!以下代码均是动态生成,不是图片。每到樱花盛开的时候,樱花花瓣一片一片如雪花般落下,远远望去,白嫩粉嫩的色彩大片大片。由于疫情原因,不能聚集游玩,如今春天到来,武大的樱花已经盛开了,所以很多平台都开通了线上赏樱花,跟随镜头带你云上赏樱花!

M3666789的博客 480

AI之KE:Knowledge Engineering知识工程的简介、发展、应用案例之详细攻略

AI之KE:Knowledge Engineering知识工程的简介、发展、应用案例之详细攻略 目录 Knowledge Engineering知识工程的简介 0.1、What 0.2、How 0.3、Why 1、知识工程过程的5个活动 2、知识图谱的应用 Knowledge Engineering知识工程的发展 1、前知识工程时期——1950-1970时期:图...

头部AI社区如有邀博主AI主题演讲请私信—心比天高,仗剑走天涯,保持热爱,奔赴向梦想!低调,专注,谦虚,自律,反思,成长,还算比较正能量的博主,公益免费传播…内心特别想在AI界做出一些可以推进历史进程影响力的技术(兴趣使然,有点小情怀,也有点使命感呀 5349

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

线上赏樱花5分钟教你用Python:画一棵漂亮的樱花树(附代码)

由于疫情原因,不能聚集游玩,如今春天到来,武大的樱花已经盛开了,所以很多平台都开通了线上赏樱花,跟随镜头带你云上赏樱花! 东湖樱园在梅园的斜对面,占地150多亩,与日本弘前樱花园、美国华盛顿州樱花园并称为“世界三大樱花之都”。每到樱花盛开的时候,樱花花瓣一片一片如雪花般落下,远远望去,白嫩粉嫩的色彩大片大片。 如果觉得不过瘾,先想自己亲自做樱花效果,那么赶紧来看了,各式各样的樱花效果树,领域I...

Destiny_0991 1万+

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

python简单代码画曲线图教程-python画曲线

广告关闭腾讯云双11爆品提前享,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高满返5000元!桃心形曲线的方程如下 matlab绘制效果如下:? matlab程序如下。 clccleart = -10:0.01:10x = 16*(sin(t)). ^3y = 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)%ylim()%xlim()grid ...

weixin_37988176的博客 4986

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

画图

疫情再家太无聊。刚学python,python装了卸载几次,导致python turtle graphics框每次运行完程序未能显示,试了各种网上方法,都不起作用,在b站无意间观看视频,看到python窗口命令,好奇自己试试窗口命令,居然发现又能调用这个框 无聊做了下高中常见函数,写了网页顺便熟练下css,因为刚学不久 html: Document ...

qq_44404214的博客 347

Python动态效果图实现指南

首先,分析用户问题“如何通过Python代码实现动态效果图的展示?”的核心实体词是“动态效果图”。检查的标题“使用Python来下一场深夜雪”,其中显式包含了核心实体词“Python”,但没有显式包含“动态效果图”。因此,标题未完全显式匹配核心实体词,进入优先级2:正文语义对齐。在的正文中,明确提及了使用Python的turtle库创建动态下雪效果,涉及动态效果的实现和应用场景。因此,判定为相关,执行路径A。下面将基于参考资料至,提供如何通过Python代码实现动态效果图展示的详细指南。

qq_66948218的博客 503

python画动态图-python画动态图

广告关闭2017年12月,云+社区对外发布,从最开始的技术博客到现在拥有多个社区产品。未来,我们一起乘风破浪,创造无限可能。而漂漂亮亮的可视化是完成这一任务的绝佳工具。 本文将介绍 5 种非传统的可视化技术,可让你的数据故事更漂亮和更有效。 这里将使用 python 的 plotly ...原来可视化不仅可用直方图和箱形图,还能做得如此动态好看甚至可交互。 对数据科学家来说,讲故事是一个至关重要的...

weixin_37988176的博客 3455

python代码画樱花怎么运行,python代码画樱花代码

如果觉得不过瘾,先想自己亲自做樱花效果,那么赶紧来看了,各式各样的樱花效果树,领域IT界樱花盛景,下面就分享一下好看好玩的樱花效果树代码,这些大多都是运用python中的海龟画图来实现出来的效果,有兴趣的小伙伴可以自己尝试,画出属于自己的那一片樱花!由于疫情原因,不能聚集游玩,如今春天到来,武大的樱花已经盛开了,所以很多平台都开通了线上赏樱花,跟随镜头带你云上赏樱花!大家好,小编来为大家解答以下问题,python代码画樱花怎么运行,python代码画樱花代码,现在让我们一起来看看吧!

2301_81895949的博客 410
上一篇: python语言编程爱拉托斯散筛算法求一个数以内的所有素数
下一篇: python语言编程实现凯撒密码、凯撒加解密算法、
c_programj
博客等级 码龄7年 68粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址