python画图全

python画图:

1.小猪佩奇

2.皮卡丘

3.巴斯光年

4.玫瑰

#小猪佩奇
# # coding:utf-8
# import turtle as t
# t.pensize(4) # 设置画笔的大小
# t.colormode(255) # 设置GBK颜色范围为0-255
# t.color((255,155,192),"pink") # 设置画笔颜色和填充颜色(pink)
# t.setup(840,500) # 设置主窗口的大小为840*500
# t.speed(0) # 设置画笔速度为10
# #鼻子
# t.pu() # 提笔
# t.goto(-100,100) # 画笔前往坐标(-100,100)
# t.pd() # 下笔
# t.seth(-30) # 笔的角度为-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) # 笔的角度为90度
# t.fd(25) # 向前移动25
# t.seth(0) # 转换画笔的角度为0
# t.fd(10)
# t.pd()
# t.pencolor(255,155,192) # 设置画笔颜色
# t.seth(10)
# t.begin_fill()
# t.circle(5) # 画一个半径为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) # 顺时针画一个半径为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)

import turtle as t

"""
=================================================
@Project ->Adversity Awake 巴斯光年系列
@类别     : 巴斯光年->巴斯光年之1
@Author  : 逆境清醒
@Date    : 2022/12/2 04:02
@Desc    :https://blog.csdn.net/weixin_69553582
=================================================
"""
# 设置背景颜色,窗口位置以及大小

t.colormode(255)  # 颜色模式
t.speed(0)
t.screensize(900, 900, "white")  # 画布大小背景颜色
t.setup(width=900, height=900, startx=None, starty=None)  # 绘图窗口的大小和起始坐标
t.title("逆境清醒巴斯光年!")  # 设置绘图窗口的标题
t.resizemode('noresize')  # 大小调整模式:auto,user,noresize
t.tracer(1)
t.hideturtle()


def mlingpen(x, y):
    t.penup()
    t.goto(x, y)
    t.pendown()


def mlingfacecheek(x, y, fx):
    mlingpen(x, y)
    t.seth(fx)
    t.pencolor("#fcd1ae")
    t.fillcolor('#fcd1ae')
    t.begin_fill()
    n = 1.8
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            n -= 0.05
            t.left(3)
            t.fd(n)
        else:
            n += 0.05
            t.left(3)
            t.fd(n)
    t.end_fill()


def mlingfacecheek_h(x, y, fx):
    mlingpen(x, y)
    t.seth(fx)
    t.pencolor("#fcc6ae")
    t.fillcolor('#fcc6ae')
    t.begin_fill()
    n = 1.6
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            n -= 0.06
            t.left(3)
            t.fd(n)
        else:
            n += 0.06
            t.left(3)
            t.fd(n)
    t.end_fill()


def mlingzuanzhou1(x, y, fx):
    mlingpen(x, y)
    t.seth(fx)
    t.pencolor("#2f2f33")
    t.fillcolor('#a0a9ae')
    t.begin_fill()
    n = 1.8
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            n -= 0.05
            t.left(3)
            t.fd(n)
        else:
            n += 0.05
            t.left(3)
            t.fd(n)
    t.end_fill()


def mlingellipse(x, y, jiajiao, l, size, color1, color2):
    mlingpen(x, y)
    t.seth(jiajiao + 270)
    t.pensize(size)
    t.pencolor(color1)
    t.fillcolor(color2)
    t.pendown()
    t.begin_fill()
    a = 0.3
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            a += l
            t.lt(3)
            t.fd(a)
        else:
            a -= l
            t.lt(3)
            t.fd(a)
    t.penup()
    t.end_fill()


def mlingrotate_left(chishu, angle, length):
    for i in range(chishu):
        t.left(angle)
        t.forward(length)


def mlingrotate_right(chishu, angle, length):
    for i in range(chishu):
        t.right(angle)
        t.forward(length)


def bsgnface():
    t.pensize(2)
    t.pencolor("#622300")
    t.fillcolor('#fdd7a4')
    t.begin_fill()
    mlingpen(-80, 0)
    t.seth(150)
    t.circle(-50, 60)
    t.seth(90)
    mlingrotate_right(10, 2, 10)
    t.circle(-70, 38)
    t.goto(-60, 210)
    t.goto(-40, 205)
    t.goto(20, 165)
    t.right(40)
    t.circle(-70, 98)
    mlingrotate_right(10, 5, 13)
    t.circle(-64, 71)
    t.goto(-80, 0)
    t.end_fill()
    # AdversityAwake
    t.pensize(1)
    t.pencolor("#fcdbae")
    t.fillcolor('#fcdbae')
    t.begin_fill()
    mlingpen(-80, 0)
    t.seth(150)
    t.circle(-50, 60)
    t.seth(90)
    mlingrotate_right(10, 2, 10)
    t.circle(-70, 38)
    t.goto(-60, 210)
    t.goto(-40, 205)
    t.goto(20, 165)
    t.right(40)
    t.circle(-60, 98)
    mlingrotate_right(10, 5, 13)
    t.circle(-64, 71)
    t.goto(-80, 0)
    t.end_fill()

    mlingellipse(-40, 130, 100, 0.06, 2, '#58302b', '#ffffff')
    mlingellipse(-10, 123, -10, 0.06, 2, '#58302b', '#ffffff')

    t.seth(0)
    mlingpen(-42, 145)
    t.pensize(3)
    t.pencolor("#362d2e")
    t.fillcolor('#3c7ec3')
    t.begin_fill()
    t.circle(13, 360)
    t.end_fill()
    mlingpen(-40, 154)
    t.fillcolor('#362d2e')
    t.begin_fill()
    t.circle(4, 360)
    t.end_fill()
    # AdversityAwake
    t.seth(0)
    mlingpen(20, 110)
    t.pensize(3)
    t.pencolor("#362d2e")
    t.fillcolor('#3c7ec3')
    t.begin_fill()
    t.circle(13, 360)
    t.end_fill()
    mlingpen(20, 120)
    t.fillcolor('#362d2e')
    t.begin_fill()
    t.circle(4, 360)
    t.end_fill()
    # AdversityAwake
    t.seth(0)
    mlingpen(-47, 166)
    t.pensize(1)
    t.pencolor("#ffffff")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.circle(2, 360)
    t.end_fill()
    # AdversityAwake
    t.seth(0)
    mlingpen(12, 126)
    t.pensize(1)
    t.pencolor("#ffffff")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.circle(2, 360)
    t.end_fill()
    # AdversityAwake
    t.seth(0)
    mlingpen(-22, 158)
    t.pensize(2)
    t.pencolor("#622300")
    t.fillcolor('#622300')
    t.begin_fill()
    t.goto(-50, 200)
    t.left(100)
    t.circle(8, 180)
    t.goto(-60, 180)
    t.left(210)
    t.circle(-5, 180)
    t.goto(-22, 150)
    t.goto(-22, 158)
    t.end_fill()
    mlingpen(-15, 158)
    t.pensize(2)
    t.pencolor("#622300")
    t.fillcolor('#622300')
    t.begin_fill()
    t.circle(40, 70)
    t.circle(-20, 180)
    t.right(100)
    t.circle(30, 50)
    t.left(30)
    mlingrotate_left(5, -5, 5)
    mlingrotate_left(5, -1, 4)
    t.goto(-15, 158)
    t.end_fill()
    # AdversityAwake
    t.seth(180)
    mlingpen(-20, 80)
    t.pensize(3)
    t.pencolor("#d1966b")
    t.fillcolor('#fccc8b')
    t.begin_fill()
    t.circle(-60, 30)
    t.circle(-10, 75)
    t.right(20)
    mlingrotate_right(5, 2, 9)
    t.circle(22, 65)
    t.pu()
    t.end_fill()
    t.seth(60)
    t.pensize(5)
    mlingpen(-45, 98)
    t.pencolor("#f8dbc4")
    mlingrotate_right(5, 2, 8)
    t.seth(-95)
    t.pensize(2)
    mlingpen(-70, 96)
    t.pencolor("#652500")
    t.fillcolor('#652500')
    t.begin_fill()
    t.circle(40, 30)
    t.seth(-40)
    t.pensize(1)
    t.pencolor("#652500")
    t.circle(70, 40)
    t.circle(30, 40)
    t.circle(2, 180)
    t.circle(-30, 40)
    t.right(2)
    t.circle(-70, 40)
    t.end_fill()
    t.seth(0)
    t.pensize(3)
    mlingpen(-42, 208)
    t.pencolor("#000000")
    t.fillcolor('#6b3f8d')
    t.begin_fill()
    t.circle(-30, 60)
    t.circle(50, 60)
    t.circle(-30, 110)
    t.circle(50, 60)
    t.circle(-30, 60)
    t.circle(5, 180)
    mlingrotate_left(5, 1, 20)
    t.circle(80, 150)
    t.goto(-42, 208)
    t.end_fill()
    t.pensize(1)
    mlingpen(-85, 15)
    t.circle(-6, 200)
    t.left(3)
    t.circle(-4, 200)
    t.left(3)
    t.circle(-2, 200)


def saihong(x, y, r):
    t.pensize(1)
    t.pencolor("#fcc6ae")
    t.fillcolor('#fcc6ae')
    t.begin_fill()
    mlingpen(x, y)
    t.circle(r, 360)
    t.end_fill()


def bsgntoukui():
    t.pensize(2)
    t.pencolor("#000000")
    t.fillcolor('#dadada')
    t.begin_fill()
    mlingpen(250, 40)
    t.seth(80)
    t.circle(240, 60)
    t.circle(200, 40)
    t.circle(250, 35)
    t.circle(228, 225)
    t.end_fill()
    # AdversityAwake
    t.pensize(3)
    t.pencolor("#5b5c5e")
    t.fillcolor('#948e92')
    t.begin_fill()
    mlingpen(160, -20)
    t.seth(60)
    t.circle(180, 50)
    t.circle(200, 50)
    t.circle(190, 35)
    t.left(8)
    t.circle(160, 50)
    t.right(5)
    t.circle(210, 15)
    t.right(90)
    t.fd(15)
    t.right(90)
    t.circle(-210, 15)
    t.left(8)
    t.circle(-160, 50)
    t.right(3)
    t.circle(-190, 35)
    t.circle(-210, 50)
    t.circle(-210, 60)
    t.right(90)
    t.fd(15)
    t.goto(160, -20)
    t.end_fill()
    # AdversityAwake
    t.pensize(3)
    t.pencolor("#32384c")
    t.fillcolor('#7d6a6d')
    t.begin_fill()
    mlingpen(220, 20)
    t.seth(80)
    t.circle(180, 50)
    t.circle(280, 50)
    t.circle(190, 20)
    t.left(2)
    t.circle(125, 65)
    t.right(90)
    t.fd(15)
    t.right(90)
    t.circle(-135, 60)
    t.left(1)
    t.circle(-145, 10)
    t.circle(-220, 30)
    t.circle(-320, 30)
    t.circle(-210, 55)
    t.right(90)
    t.fd(15)
    t.goto(220, 20)
    t.end_fill()

    mlingellipse(-195, 43, -5, 0.50, 3, '#37363d', '#37363d')
    mlingellipse(-230, 40, 80, 0.13, 3, '#76828e', '#a0a9ae')
    mlingellipse(-220, 40, 80, 0.13, 3, '#a0a9ae', '#393843')
    mlingellipse(-210, 45, 80, 0.11, 3, '#6a6776', '#6a6776')
    mlingellipse(-198, 45, 80, 0.11, 3, '#52445c', '#5e5763')
    mlingellipse(-190, 40, 80, 0.09, 3, '#a0a9ae', '#a0a9ae')
    mlingellipse(-176, 40, 80, 0.09, 3, '#55535d', '#393843')

    t.seth(0)
    t.pensize(3)
    t.pencolor("#32384c")
    t.fillcolor('#7d6a6d')
    t.begin_fill()
    mlingpen(220, 80)
    t.end_fill()

    # def bsgnyifu():

    t.seth(180)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    mlingpen(-330, 40)
    t.fd(25)
    t.circle(30, 80)
    t.circle(250, 30)
    t.circle(30, 130)
    t.goto(-330, 40)
    t.end_fill()

    t.seth(180)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    t.begin_fill()
    mlingpen(-285, 55)
    t.fd(20)
    t.circle(30, 70)
    t.circle(250, 35)
    t.circle(30, 130)
    t.left(57)
    t.circle(-250, 40)
    t.goto(-285, 55)
    t.end_fill()
    t.seth(0)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    t.begin_fill()
    mlingpen(-180, -280)
    t.goto(-180, -330)
    t.right(33)
    t.circle(300, 65)
    t.goto(-180, -280)
    t.end_fill()
    t.seth(-90)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    mlingpen(-280, -160)
    t.goto(-240, -270)
    t.goto(160, -350)
    t.goto(250, -240)
    t.goto(250, -90)
    t.goto(-280, -160)
    t.end_fill()
    t.seth(-100)
    t.pensize(3)
    t.pencolor("#51265d")
    t.fillcolor('#6b3f8d')
    t.begin_fill()
    mlingpen(250, -240)
    t.circle(-55, 80)
    t.circle(-210, 50)
    t.goto(0, -260)
    t.left(180)
    t.circle(210, 50)
    t.left(10)
    t.circle(100, 50)
    t.goto(250, -240)
    t.up()
    t.end_fill()
    t.seth(-100)
    t.begin_fill()
    mlingpen(-250, -180)
    t.goto(-280, -200)
    t.circle(40, 85)
    t.goto(-200, -210)
    t.goto(-250, -180)
    t.end_fill()
    t.seth(160)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    mlingpen(260, -260)
    t.begin_fill()
    t.circle(-80, 60)
    t.right(20)
    t.circle(-280, 35)
    t.circle(-80, 70)
    t.right(61)
    t.circle(-280, 60)
    t.goto(260, -260)
    t.end_fill()


def bsgnyifushangyi():
    t.seth(60)
    t.pensize(3)
    mlingpen(-200, -10)
    t.pencolor("#51265d")
    t.fillcolor('#6b3f8d')
    t.begin_fill()
    t.circle(-150, 40)
    t.circle(-285, 70)
    t.right(90)
    t.circle(-300, 85)
    t.goto(-200, -10)
    t.end_fill()
    # AdversityAwake
    t.seth(33)
    t.pensize(3)
    t.pencolor("#375502")
    t.fillcolor('#6ba812')
    t.begin_fill()
    mlingpen(-160, 40)
    t.circle(-150, 26)
    t.right(160)
    t.circle(50, 73)
    t.right(-90)
    t.fd(10)
    t.goto(-100, -85)
    t.right(-145)
    t.circle(-150, 40)
    t.circle(-43, 77)
    t.goto(-160, 40)
    t.up()
    t.end_fill()
    # AdversityAwake
    t.seth(8)
    t.begin_fill()
    mlingpen(-110, -10)
    t.circle(-150, 45)
    t.goto(30, -20)
    t.goto(35, -35)
    t.goto(165, 20)
    t.right(20)
    t.fd(90)
    t.right(83)
    t.circle(-280, 69)
    t.goto(-110, -10)
    t.end_fill()
    t.pensize(3)
    mlingpen(30, -20)
    t.goto(-90, -90)
    mlingpen(30, -20)
    t.right(-135)
    t.fd(90)


def mylinganniu(x, y, fx, yuan, fd1, color1, color2, color3, color4):
    t.seth(fx)
    t.pensize(3)
    t.pencolor(color1)
    t.fillcolor(color2)
    t.begin_fill()
    mlingpen(x, y)
    t.circle(-yuan, 180)
    t.fd(fd1)
    t.circle(-yuan, 180)
    t.fd(fd1)
    t.end_fill()
    mlingpen(x - 8, y)
    t.pencolor(color3)
    t.fillcolor(color4)
    t.begin_fill()
    t.circle(-yuan, 180)
    t.fd(fd1)
    t.circle(-yuan, 180)
    t.fd(fd1)
    t.end_fill()


def gsgnwaiyi():
    t.seth(-180)
    t.pensize(3)
    t.pencolor("#467602")
    t.fillcolor('#6ba812')
    t.begin_fill()
    mlingpen(-240, 90)
    t.circle(50, 60)
    t.circle(210, 100)
    t.goto(-120, -230)
    t.goto(-50, -260)
    t.left(20)
    t.circle(330, 35)
    t.left(2)
    t.circle(330, 30)
    t.goto(320, 70)
    t.goto(240, 160)
    t.left(210)
    t.circle(-200, 50)
    t.circle(-250, 40)
    t.circle(-320, 55)
    t.goto(-240, 90)
    t.end_fill()
    # AdversityAwake
    t.seth(-100)
    t.pensize(3)
    t.pencolor("#ffffff")
    t.fillcolor('#ffffff')
    t.begin_fill()
    mlingpen(-164, -65)
    t.circle(280, 15)
    t.circle(20, 80)
    t.right(10)
    t.circle(310, 12)
    t.circle(20, 80)
    t.circle(-280, 12)
    t.goto(-40, -95)
    t.goto(-164, -65)
    t.end_fill()
    # AdversityAwake
    t.seth(-100)
    t.pensize(3)
    t.pencolor("#7cc4df")
    t.fillcolor('#7cc4df')
    t.begin_fill()
    mlingpen(-155, -85)
    t.circle(280, 10)
    t.circle(20, 80)
    t.right(8)
    t.circle(310, 9)
    t.circle(20, 80)
    t.circle(-280, 10)
    t.right(-85)
    t.circle(150, 40)
    t.goto(-155, -85)
    t.end_fill()
    # AdversityAwake
    t.pencolor("#000000")
    mlingpen(-120, -120)
    t.goto(-150, -110)
    t.goto(-145, -140)
    t.goto(-130, -143)
    t.circle(3, 190)
    t.goto(-120, -160)
    t.goto(-110, -153)
    t.right(60)
    t.circle(4, 150)
    t.goto(-85, -153)
    t.goto(-65, -123)
    t.goto(-100, -123)
    t.goto(-110, -110)
    t.goto(-120, -120)
    mlingpen(-120, -127)
    t.goto(-145, -120)
    mlingpen(-120, -134)
    t.goto(-145, -127)
    mlingpen(-120, -141)
    t.goto(-145, -134)
    mlingpen(-108, -129)
    t.goto(-75, -130)
    mlingpen(-108, -136)
    t.goto(-77, -137)
    mlingpen(-108, -143)
    t.goto(-80, -144)
    mlingpen(-105, -110)
    t.write("SPACERANGER", align="center", font=("黑体", 10, "normal"))
    t.seth(0)
    t.pensize(2)
    t.pencolor("#000000")
    t.fillcolor('#b5bf55')
    t.begin_fill()
    mlingpen(-40, -150)
    t.fd(120)
    t.left(90)
    t.fd(30)
    t.left(90)
    t.fd(120)
    t.left(90)
    t.fd(30)
    t.left(90)
    t.end_fill()
    mlingpen(20, -140)
    t.write("LIGHTYEAR.AA", align="center", font=("黑体", 12, "normal"))

    t.seth(-130)
    t.pensize(3)
    t.pencolor("#375502")
    t.fillcolor('#375502')
    t.begin_fill()
    mlingpen(-240, 90)
    t.circle(170, 60)
    t.left(165)
    t.circle(-170, 38)
    t.goto(-240, 90)
    t.end_fill()
    t.seth(-120)
    mlingpen(-245, 20)
    t.pensize(7)
    t.circle(35, 80)
    t.right(2)
    t.circle(280, 18)
    t.right(75)
    t.circle(280, 15)
    t.circle(20, 80)
    t.right(70)
    t.goto(-125, -170)
    t.goto(-125, -230)
    mlingpen(-115, -230)
    t.goto(-115, -170)
    t.left(70)
    t.fd(30)
    t.circle(20, 80)
    t.circle(-280, 12)
    t.right(75)
    t.circle(350, 38)
    t.seth(0)
    t.pensize(3)
    mlingpen(200, -60)
    t.goto(80, -200)

    mlingellipse(-39, -190, 0, 0.1, 2, '#97bf54', '#97bf54')
    mlingellipse(-32, -190, 0, 0.08, 2, '#520600', '#a3020c')
    mlingellipse(-33, -190, 0, 0.07, 2, '#d0272b', '#cb0310')
    mylinganniu(-260, -100, 90, 10, 50, '#001d29', '#00417c', '#2172cd', '#005cc1')
    mylinganniu(-230, -120, 90, 10, 50, '#002900', '#11400c', '#127b34', '#438f51')
    mylinganniu(-200, -140, 90, 10, 50, '#2d0f00', '#800707', '#e34441', '#e0524b')


def bsgnshou():
    t.seth(0)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    mlingpen(215, -35)
    t.circle(36)
    t.end_fill()
    t.begin_fill()
    mlingpen(220, 35)
    t.goto(200, 80)
    t.goto(150, 140)
    t.left(120)
    t.circle(20, 90)
    t.left(-90)
    t.circle(20, 50)
    t.left(-50)
    t.circle(100, 60)
    t.circle(15, 150)
    t.left(-50)
    t.circle(20, 60)
    t.left(-50)
    t.circle(20, 60)
    t.circle(-90, 40)
    t.left(-50)
    t.circle(20, 60)
    t.goto(110, 50)
    t.goto(110, 30)
    t.left(-150)
    t.circle(-90, 40)
    t.circle(15, 180)
    t.circle(110, 70)
    t.left(-50)
    t.circle(50, 30)
    t.goto(220, 35)
    t.end_fill()
    t.seth(0)
    t.begin_fill()
    mlingpen(320, -200)
    t.goto(200, -75)
    t.left(120)
    t.circle(-20, 80)
    t.fd(70)
    t.circle(-20, 60)
    t.goto(370, -100)
    t.goto(320, -200)
    t.end_fill()
    t.seth(120)
    t.pencolor("#000000")
    t.fillcolor('#6b3f8d')
    t.begin_fill()
    mlingpen(150, 140)
    t.circle(20, 90)
    t.left(-90)
    t.circle(20, 200)
    t.left(-50)
    t.circle(20, 70)
    t.goto(150, 140)
    t.end_fill()
    t.seth(160)
    mlingpen(22.23, 207.02)
    t.begin_fill()
    t.circle(15, 200)
    t.end_fill()
    t.left(-10)
    t.circle(-100, 50)
    t.seth(130)
    mlingpen(56.68, 60.78)
    t.begin_fill()
    t.circle(15, 200)
    t.end_fill()


def bsgnyifuhuibian():
    t.seth(90)
    t.pensize(3)
    t.pencolor("#696d7e")
    t.fillcolor('#838a95')
    t.begin_fill()
    mlingpen(-180, 60)
    t.circle(23, 155)
    t.circle(250, 10)
    t.circle(50, 60)
    t.circle(300, 10)
    t.left(6)
    t.circle(330, 10)
    t.circle(330, 10)
    t.right(6)

    t.circle(350, 65)
    t.circle(28, 185)
    t.circle(-320, 30)
    t.right(6)
    t.circle(-320, 25)
    t.left(7)
    t.circle(-270, 30)
    t.right(6)
    t.circle(-65, 90)
    t.goto(-180, 60)
    t.end_fill()

    t.pencolor("#696d7e")
    t.fillcolor('#696d7e')
    t.begin_fill()
    t.seth(90)
    t.circle(23, 50)
    t.left(-270)
    t.circle(65, 100)
    t.left(160)
    t.circle(-65, 70)
    t.goto(-180, 60)
    t.end_fill()


t.pencolor("#003d78")
t.penup()
t.goto(390, 145)
t.pendown()
t.write("拥\n有\n无\n所\n畏\n惧\n的\n勇\n气\n", align="center", font=("黑体", 20, "normal"))

mlingpen(350, 215)
t.write("逆\n境\n清\n醒\n愿\n你\n:\n", align="center", font=("黑体", 16, "normal"))

if __name__ == '__main__':
    t.seth(0)
    t.pensize(25)
    mlingpen(0, -380)
    t.pencolor("#000000")
    t.fillcolor('#b3e3f0')
    t.begin_fill()
    t.circle(380)
    t.end_fill()
    bsgntoukui()
    bsgnyifushangyi()
    bsgnface()
    mlingfacecheek(-55, 125, 90)
    saihong(-60, 115, 12)
    mlingfacecheek(18, 66, 10)
    saihong(10, 68, 12)
    # bsgnyifu()
    gsgnwaiyi()
    bsgnyifuhuibian()
    bsgnshou()
    t.seth(0)
    t.pensize(25)
    mlingpen(0, -380)
    t.pencolor("#000000")
    t.circle(380, 720)
    t.done()



玫瑰
import turtle

turtle.speed(5)

# 设置初始位置

turtle.penup()

turtle.left(90)

turtle.fd(200)

turtle.pendown()

turtle.right(90)
# 花蕊

turtle.fillcolor("red")

turtle.begin_fill()

turtle.circle(10, 180)

turtle.circle(25, 110)

turtle.left(50)

turtle.circle(60, 45)

turtle.circle(20, 170)

turtle.right(24)

turtle.fd(30)

turtle.left(10)

turtle.circle(30, 110)

turtle.fd(20)

turtle.left(40)

turtle.circle(90, 70)

turtle.circle(30, 150)

turtle.right(30)

turtle.fd(15)

turtle.circle(80, 90)

turtle.left(15)

turtle.fd(45)

turtle.right(165)

turtle.fd(20)

turtle.left(155)

turtle.circle(150, 80)

turtle.left(50)

turtle.circle(150, 90)

turtle.end_fill()

# 花瓣1

turtle.left(150)

turtle.circle(-90, 70)

turtle.left(20)

turtle.circle(75, 105)

turtle.setheading(60)

turtle.circle(80, 98)

turtle.circle(-90, 40)

# 花瓣2

turtle.left(180)

turtle.circle(90, 40)

turtle.circle(-80, 98)

turtle.setheading(-83)

# 叶子1

turtle.fd(30)

turtle.left(90)

turtle.fd(25)

turtle.left(45)

turtle.fillcolor("green")

turtle.begin_fill()

turtle.circle(-80, 90)

turtle.right(90)

turtle.circle(-80, 90)

turtle.end_fill()

turtle.right(135)

turtle.fd(60)

turtle.left(180)

turtle.fd(85)

turtle.left(90)

turtle.fd(80)

# 叶子2

turtle.right(90)

turtle.right(45)

turtle.fillcolor("green")

turtle.begin_fill()

turtle.circle(80, 90)

turtle.left(90)

turtle.circle(80, 90)

turtle.end_fill()

turtle.left(135)

turtle.fd(60)

turtle.left(180)

turtle.fd(60)

turtle.right(90)

turtle.circle(200, 60)
turtle.done()

# -*- coding: UTF-8 -*-
# import turtle as t

# """
# =================================================
# @Project ->Adversity Awake 玫瑰花系列
# @类别     : 玫瑰花->玫瑰花之1
# @Author  : 逆境清醒
# @Date    : 2022/11/10 1:46
# @Desc    :https://blog.csdn.net/weixin_69553582
# =================================================
# """
# # 设置背景颜色,窗口位置以及大小
#
# t.colormode(255)  # 颜色模式
# t.speed(0)
# t.screensize(800, 760, "white")  # 画布大小背景颜色
# t.setup(width=800, height=760, startx=None, starty=None)  # 绘图窗口的大小和起始坐标
# # t.bgpic("ditu3.gif")
# t.title("逆境清醒玫瑰花!")  # 设置绘图窗口的标题
# t.resizemode('noresize')  # 大小调整模式:auto,user,noresize
# t.tracer(0)
#
#
# def mlingpen(x, y):
#     t.penup()
#     t.goto(x, y)
#     t.pendown()
#
#
# def rose():  # rose
#     t.seth(75)
#     mlingpen(-235, -150)
#     t.pensize(10)
#     t.pencolor("#035025")
#     t.circle(300, 40)
#     mlingpen(-240, 70)
#
#     t.pensize(2)
#     t.color("#000000", "#22ac38")
#     t.seth(12)
#     mlingpen(-235, 40)
#     t.lt(40)
#     t.fd(50)
#     t.begin_fill()
#     t.circle(-150, 30)
#     t.circle(-2, 140)
#     t.circle(-150, 43)
#     t.up()
#     t.end_fill()
#     mlingpen(-235, 40)
#     t.lt(330)
#     t.fd(50)
#     t.begin_fill()
#     t.circle(-150, 30)
#     t.circle(-2, 140)
#     t.circle(-150, 43)
#     t.up()
#     t.end_fill()
#     mlingpen(-235, 40)
#     t.lt(260)
#     t.fd(50)
#     t.begin_fill()
#     t.circle(-150, 30)
#     t.circle(-2, 140)
#     t.circle(-150, 43)
#     t.up()
#     t.end_fill()
#
#     t.pensize(2)
#     t.seth(12)
#     mlingpen(-210, 60)
#     t.begin_fill()
#     t.color("#000000", "#f8c0c8")
#     t.circle(50, 150)
#     t.rt(20)
#     t.fd(40)
#     t.rt(40)
#     t.circle(15, 130)
#     t.fd(50)
#     t.circle(15, 80)
#     t.up()
#     t.end_fill()
#     t.pensize(2)
#     t.seth(12)
#     mlingpen(-210, 65)
#     t.begin_fill()
#     t.color("#f5aab5", "#f5aab5")
#     t.circle(34, 150)
#     t.rt(20)
#     t.fd(30)
#     t.rt(40)
#     t.circle(10, 130)
#     t.fd(50)
#     t.circle(15, 80)
#     t.up()
#     t.end_fill()
#     t.pensize(2)
#     t.seth(12)
#     mlingpen(-210, 65)
#     t.begin_fill()
#     t.color("#f198a5", "#f198a5")
#     t.circle(30, 150)
#     t.rt(20)
#     t.fd(30)
#     t.rt(40)
#     t.circle(10, 130)
#     t.fd(50)
#     t.circle(15, 80)
#     t.up()
#     t.end_fill()
#     t.pensize(2)
#     t.seth(12)
#     mlingpen(-210, 65)
#     t.begin_fill()
#     t.color("#ee8998", "#ee8998")
#     t.circle(20, 150)
#     t.rt(20)
#     t.fd(30)
#     t.rt(40)
#     t.circle(10, 130)
#     t.fd(50)
#     t.circle(15, 80)
#     t.up()
#     t.end_fill()
#     mlingpen(-220, 80)
#     t.begin_fill()
#     t.color("#e56e7f", "#e56e7f")
#     t.circle(15, 200)
#     t.rt(20)
#     t.fd(30)
#     t.rt(40)
#     t.circle(10, 130)
#     t.fd(50)
#     t.circle(15, 80)
#     t.up()
#     t.end_fill()
#     t.seth(35)
#     mlingpen(-230, 90)
#     t.begin_fill()
#     t.color("#000000", "#fda7b5")
#     t.circle(50, 50)
#     t.rt(40)
#     t.circle(25, 200)
#     t.up()
#     t.end_fill()
#     t.seth(130)
#     mlingpen(-294.51, 142.14)  # 内4
#     t.begin_fill()
#     t.color("#000000", "#fdadb8")
#     t.circle(20, 100)
#     t.rt(90)
#     t.circle(10, 180)
#     t.rt(90)
#     t.circle(15, 130)
#     t.rt(110)
#     t.circle(30, 130)
#     t.rt(50)
#     t.circle(50, 80)
#     t.up()
#     t.end_fill()
#     t.seth(80)
#     mlingpen(-240, 140)
#     t.begin_fill()
#     t.color("#000000", "#fe8e9e")
#     t.circle(10, 100)
#     t.rt(90)
#     t.circle(12, 150)
#     t.rt(90)
#     t.circle(15, 130)
#     t.rt(50)
#     t.circle(50, 80)
#     t.rt(10)
#     t.circle(50, 80)
#     t.goto(-240, 140)
#     t.up()
#     t.end_fill()
#     t.seth(80)
#     mlingpen(-250, 140)
#     t.begin_fill()
#     t.color("#f9788b", "#f9788b")
#     t.circle(5, 130)
#     t.rt(90)
#     t.circle(10, 170)
#     t.rt(100)
#     t.circle(10, 130)
#     t.rt(70)
#     t.circle(40, 80)
#     t.rt(40)
#     t.circle(30, 30)
#     t.goto(-250, 140)
#     t.up()
#     t.end_fill()
#     t.seth(10)
#     mlingpen(-245, 80)
#     t.begin_fill()
#     t.color("#000000", "#ef5f7a")
#     t.seth(35)
#     t.circle(30, 80)
#     t.rt(80)
#     t.circle(10, 150)
#     t.rt(80)
#     t.circle(17, 200)
#     t.rt(60)
#     t.circle(29, 120)
#     t.goto(-245, 80)
#     t.up()
#     t.end_fill()
#     t.seth(10)
#     mlingpen(-250, 85)
#     t.begin_fill()
#     t.color("#ef758c", "#ef758c")
#     t.seth(35)
#     t.circle(25, 80)
#     t.rt(80)
#     t.circle(6, 150)
#     t.rt(80)
#     t.circle(12, 210)
#     t.rt(60)
#     t.circle(23, 120)
#     t.goto(-250, 85)
#     t.up()
#     t.end_fill()
#     t.seth(0)
#     mlingpen(-250, 125)
#     t.pensize(5)
#     t.dot("#ff4969")
#     t.pensize(2)
#     mlingpen(-266.97, 121.26)
#     t.pencolor("#321320")
#     t.fillcolor("#f04969")
#     t.begin_fill()
#     t.rt(80)
#     t.circle(12, 150)
#     t.rt(80)
#     t.circle(6, 270)
#     t.rt(150)
#     t.circle(10, 180)
#     t.up()
#     t.end_fill()
#     # t.color("#000000", "#f04969")
#     t.seth(-70)
#     mlingpen(-210, 100)
#     t.begin_fill()
#     t.color("#000000", "#f04969")
#     t.rt(20)
#     t.fd(30)
#     t.circle(-40, 170)
#     t.lt(20)
#     t.fd(20)
#     t.goto(-210, 100)
#     t.up()
#     t.end_fill()
#     t.seth(-70)
#     mlingpen(-215, 90)
#     t.begin_fill()
#     t.color("#ee627d", "#ee627d")
#     t.rt(20)
#     t.fd(20)
#     t.circle(-35, 170)
#     t.lt(20)
#     t.fd(15)
#     t.goto(-220, 90)
#     t.up()
#     t.end_fill()
#     t.seth(-70)
#     mlingpen(-220, 80)
#     t.begin_fill()
#     t.color("#f47a91", "#f47a91")
#     t.rt(20)
#     t.fd(10)
#     t.circle(-28, 170)
#     t.lt(20)
#     t.fd(10)
#     t.goto(-220, 90)
#     t.up()
#     t.end_fill()
#
#     t.seth(150)
#     mlingpen(-220, 100)
#     t.begin_fill()
#     t.color("#000000", "#f7cad1")
#     t.circle(20, 80)
#     t.rt(10)
#     t.circle(-40, 70)
#     t.rt(10)
#     t.circle(20, 80)
#     t.rt(5)
#     t.circle(5, 180)
#     t.rt(80)
#     t.circle(20, 70)
#     t.rt(80)
#     t.circle(40, 60)
#     t.rt(10)
#     t.circle(40, 110)
#     t.goto(-220, 100)
#     t.up()
#     t.end_fill()
#     t.seth(150)
#     mlingpen(-220, 98)
#     t.begin_fill()
#     t.color("#ffe9f2", "#ffe9f2")
#     t.circle(15, 80)
#     t.rt(7)
#     t.circle(-45, 75)
#     t.rt(8)
#     t.circle(20, 50)
#     t.rt(5)
#     t.circle(2, 200)
#     t.rt(80)
#     t.circle(15, 85)
#     t.rt(80)
#     t.circle(40, 60)
#     t.rt(20)
#     t.circle(30, 70)
#     t.goto(-220, 98)
#     t.up()
#     t.end_fill()
#     t.seth(150)
#     mlingpen(-180, 55)
#     t.begin_fill()
#     t.color("#000000", "#f7cad1")
#     t.circle(30, 80)
#     t.rt(10)
#     t.circle(-60, 70)
#     t.rt(5)
#     t.circle(30, 80)
#     t.rt(5)
#     t.circle(5, 180)
#     t.rt(90)
#     t.circle(30, 80)
#     t.rt(80)
#     t.circle(40, 70)
#     t.circle(20, 50)
#     t.rt(90)
#     t.circle(20, 95)
#     t.goto(-180, 55)
#     t.up()
#     t.end_fill()
#     t.seth(150)
#     mlingpen(-190, 50)
#     t.begin_fill()
#     t.color("#f7e0e3", "#f7e0e3")
#     t.circle(25, 80)
#     t.rt(8)
#     t.circle(-55, 75)
#     t.rt(3)
#     t.circle(25, 60)
#     t.rt(6)
#     t.circle(5, 200)
#     t.rt(90)
#     t.circle(30, 80)
#     t.rt(80)
#     t.circle(22, 80)
#     t.circle(20, 40)
#     t.rt(80)
#     t.circle(15, 90)
#     t.goto(-190, 50)
#     t.up()
#     t.end_fill()
#
#
# rose()
# t.hideturtle()
# t.done()
#

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值