用Python Turtle库画b站logo(张野 付博林组)

Posted 绅刂士

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用Python Turtle库画b站logo(张野 付博林组)相关的知识,希望对你有一定的参考价值。

视频就在这里

 

由于不知道很多函数只等自己一点一点的试??
哔哩哔哩 (゜-゜)つロ 干杯~

 

import turtle
turtle.speed(6)
turtle.screensize(300,300)
turtle.colormode(255)
turtle.color(0,204,255)
turtle.up()
turtle.goto(130,230)
turtle.down()
for _ in range(2):
    turtle.pensize(18)
    turtle.circle(-20,90)
    turtle.pensize(20)
    turtle.fd(190)
    turtle.pensize(18)
    turtle.circle(-20,90)
    turtle.pensize(20)
    turtle.fd(260)
turtle.up()
turtle.goto(20,230)
turtle.left(45)
turtle.down()
turtle.pensize(13)
turtle.fd(75)
turtle.up()
turtle.goto(-20,230)
turtle.left(90)
turtle.down()
turtle.fd(75)
turtle.up()
turtle.goto(65,-8)
turtle.pensize(1)
turtle.down()
turtle.color((0,204,255),(0,204,255))
turtle.begin_fill()
turtle.left(135)
turtle.circle(13,180)
turtle.end_fill()
turtle.up()
turtle.goto(-65,-8)
turtle.down()
turtle.begin_fill()
turtle.circle(13,-180)
turtle.end_fill()
turtle.up()
turtle.goto(0,80)
turtle.down()
turtle.begin_fill()
turtle.right(30)
turtle.circle(-15,120)
turtle.left(90)
turtle.fd(10)
turtle.left(90)
turtle.circle(25,90)
turtle.end_fill()
turtle.begin_fill()
turtle.up()
turtle.goto(0,80)
turtle.down()
turtle.right(-90)
turtle.circle(-15,-120)
turtle.left(90)
turtle.fd(10)
turtle.left(90)
turtle.circle(25,-90)
turtle.end_fill()
turtle.up()
turtle.goto(45,180)
turtle.left(15)
turtle.down()
turtle.begin_fill()
for _ in range(2):
    turtle.fd(70)
    turtle.right(90)
    turtle.fd(22)
    turtle.right(90)
turtle.end_fill()
turtle.right(150)
turtle.up()
turtle.goto(-45,180)
turtle.down()
turtle.begin_fill()
for _ in range(2):
    turtle.fd(70)
    turtle.left(90)
    turtle.fd(22)
    turtle.left(90)
turtle.end_fill()
turtle.up()
#B
turtle.goto(-180,-120)
turtle.left(80)
turtle.down()
turtle.begin_fill()
turtle.fd(90)
turtle.right(5)
turtle.fd(40)
turtle.left(90)
for i in range(10):
    turtle.left(0.5)
    turtle.fd(4)
for i in range(40):
    turtle.left(1)
    turtle.fd(0.5)
for i in range(90):
    turtle.left(1)
    turtle.fd(0.25)
for i in range(40):
    turtle.left(1)
    turtle.fd(0.5) 
for i in range(10):
    turtle.left(0.5)
    turtle.fd(3)
turtle.right(92)
turtle.fd(100)
turtle.goto(-180,-120)
turtle.end_fill()
turtle.color((0,204,255),(255,255,255))
turtle.begin_fill()
turtle.up()
turtle.goto(-150,-220)
turtle.left(180)
turtle.down()
for i in range(3):
    turtle.fd(23)
    turtle.left(120)
turtle.end_fill()
#I
turtle.color((0,204,255),(0,204,255))
turtle.up()
turtle.goto(-100,-140)
turtle.left(10)
turtle.color((0,204,255),(0,204,255))
turtle.begin_fill()
turtle.down()
for i in range(2):
    turtle.fd(23)
    turtle.left(90)
    turtle.fd(8)
    turtle.left(90)
turtle.up()
turtle.goto(-90,-140)
turtle.down()
for i in range(2):
    turtle.fd(25)
    turtle.left(90)
    turtle.fd(8)
    turtle.left(90)
turtle.end_fill()
turtle.begin_fill()
turtle.up()
turtle.goto(-95,-180)
turtle.down()
turtle.fd(70)
turtle.left(90)
turtle.fd(10)
turtle.left(85)
turtle.fd(70)
turtle.goto(-95,-180)
turtle.end_fill()
#L
turtle.begin_fill()
turtle.up()
turtle.goto(-70,-110)
turtle.down()
turtle.right(177)
turtle.fd(130)
turtle.left(87)
turtle.fd(8)
turtle.left(90)
turtle.fd(130)
turtle.goto(-70,-110)
turtle.left(180)
turtle.end_fill()
#I
turtle.up()
turtle.goto(-40,-140)
turtle.color((0,204,255),(0,204,255))
turtle.begin_fill()
turtle.down()
for i in range(2):
    turtle.fd(23)
    turtle.left(90)
    turtle.fd(8)
    turtle.left(90)
turtle.up()
turtle.goto(-30,-140)
turtle.down()
for i in range(2):
    turtle.fd(25)
    turtle.left(90)
    turtle.fd(8)
    turtle.left(90)
turtle.end_fill()
turtle.begin_fill()
turtle.up()
turtle.goto(-35,-180)
turtle.down()
turtle.fd(70)
turtle.left(90)
turtle.fd(10)
turtle.left(85)
turtle.fd(70)
turtle.goto(-35,-180)
turtle.end_fill()
turtle.left(107)
turtle.up()
#B
turtle.goto(0,-120)
turtle.left(80)
turtle.down()
turtle.begin_fill()
turtle.fd(90)
turtle.right(5)
turtle.fd(40)
turtle.left(90)
for i in range(10):
    turtle.left(0.5)
    turtle.fd(4)
for i in range(40):
    turtle.left(1)
    turtle.fd(0.5)
for i in range(90):
    turtle.left(1)
    turtle.fd(0.25)
for i in range(40):
    turtle.left(1)
    turtle.fd(0.5) 
for i in range(10):
    turtle.left(0.5)
    turtle.fd(3)
turtle.right(92)
turtle.fd(100)
turtle.goto(0,-120)
turtle.end_fill()
turtle.color((0,204,255),(255,255,255))
turtle.begin_fill()
turtle.up()
turtle.goto(30,-220)
turtle.left(180)
turtle.down()
for i in range(3):
    turtle.fd(23)
    turtle.left(120)
turtle.end_fill()
#I
turtle.color((0,204,255),(0,204,255))
turtle.up()
turtle.goto(80,-140)
turtle.left(10)
turtle.color((0,204,255),(0,204,255))
turtle.begin_fill()
turtle.down()
for i in range(2):
    turtle.fd(23)
    turtle.left(90)
    turtle.fd(8)
    turtle.left(90)
turtle.up()
turtle.goto(90,-140)
turtle.down()
for i in range(2):
    turtle.fd(25)
    turtle.left(90)
    turtle.fd(8)
    turtle.left(90)
turtle.end_fill()
turtle.begin_fill()
turtle.up()
turtle.goto(85,-180)
turtle.down()
turtle.fd(70)
turtle.left(90)
turtle.fd(10)
turtle.left(85)
turtle.fd(70)
turtle.goto(85,-180)
turtle.end_fill()
#L
turtle.begin_fill()
turtle.up()
turtle.goto(110,-110)
turtle.down()
turtle.right(177)
turtle.fd(130)
turtle.left(87)
turtle.fd(8)
turtle.left(90)
turtle.fd(130)
turtle.goto(110,-110)
turtle.left(180)
turtle.end_fill()
#I
turtle.up()
turtle.goto(140,-140)
turtle.color((0,204,255),(0,204,255))
turtle.begin_fill()
turtle.down()
for i in range(2):
    turtle.fd(23)
    turtle.left(90)
    turtle.fd(8)
    turtle.left(90)
turtle.up()
turtle.goto(150,-140)
turtle.down()
for i in range(2):
    turtle.fd(25)
    turtle.left(90)
    turtle.fd(8)
    turtle.left(90)
turtle.end_fill()
turtle.begin_fill()
turtle.up()
turtle.goto(145,-180)
turtle.down()
turtle.fd(70)
turtle.left(90)
turtle.fd(10)
turtle.left(85)
turtle.fd(70)
turtle.goto(145,-180)
turtle.end_fill()
turtle.hideturtle()
turtle.mainloop()

 


以上是关于用Python Turtle库画b站logo(张野 付博林组)的主要内容,如果未能解决你的问题,请参考以下文章

python用turtle库画一棵树

海龟库画春联怎么画

Python&七夕程序员的小浪漫一一樱花树

用turtle库画四朵随机的雪花

Python-turtle库画樱花树

Python中如何用turtle库画出小猪佩奇社会人