Python教程

使用Python turtle 库画学校大门

本文主要是介绍使用Python turtle 库画学校大门,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
import turtle as t
t.speed(10)
t.hideturtle()
t.setup(width=0.9, height=0.9)
t.penup()
t.goto(-65,50)
t.pendown()
t.color("black","red")
t.begin_fill()
t.fd(130)
t.left(85)
t.fd(45)
t.left(95)
t.fd(138)
t.left(95)
t.fd(45)
t.end_fill()
printer=t.Turtle()
printer.write("泰州学院\n\n", align="center", font=("楷体",22, "bold"))
t.penup()
t.goto(-85,40)
t.pendown()
t.left(85)
t.fd(170)
t.left(85)
t.fd(75)
t.left(95)
t.fd(185)
t.left(95)
t.fd(75)
t.right(95)
t.fd(95)
t.right(90)
t.fd(80)
t.right(90)
t.fd(360)
t.right(90)
t.fd(80)
t.right(90)
t.fd(95)
t.penup()
t.goto(-175,120)
t.pendown()
t.fd(20)
t.right(90)
t.fd(20)
t.right(90)
t.fd(390)
t.right(90)
t.fd(20)
t.right(90)
t.fd(20)
t.penup()
t.goto(-150,160)
t.pendown()
t.right(180)
t.fd(315)
t.right(90)
t.fd(10)
t.right(90)
t.fd(5)
t.left(90)
t.fd(10)
t.right(90)
t.fd(5)
t.right(90)
t.fd(10)
t.left(90)
t.fd(90)
t.left(90)
t.fd(10)
t.right(90)
t.fd(5)
t.right(90)
t.fd(10)
t.left(90)
t.fd(110)
t.left(90)
t.fd(10)
t.right(90)
t.fd(5)
t.right(90)
t.fd(10)
t.left(90)
t.fd(85)
t.left(90)
t.fd(10)
t.right(90)
t.fd(5)
t.right(90)
t.fd(10)
t.left(90)
t.fd(5)
t.right(90)
t.fd(10)
t.penup()
t.goto(-195,130)
t.pendown()
t.left(90)
t.fd(95)
t.left(90)
t.fd(10)
t.left(90)
t.fd(95)
t.goto(-290,120)
t.right(90)
t.fd(330)
t.left(90)
t.fd(95)
t.left(90)
t.fd(330)
t.goto(-195,-210)
t.right(75)
t.fd(70)
t.left(75)
t.fd(202)
t.right(90)
t.fd(258)
t.right(90)
t.fd(202)
t.left(75)
t.fd(68)
t.left(105)
t.fd(340)
t.right(90)
t.fd(95)
t.right(90)
t.fd(10)
t.right(90)
t.fd(95)
t.left(90)
t.fd(330)
t.left(90)
t.fd(95)
t.left(90)
t.fd(330)
t.penup()
t.goto(-180,40)
t.pendown()
t.right(120)
t.fd(65)
t.penup()
t.goto(180,40)
t.pendown()
t.right(120)
t.fd(60)
t.penup()
t.home()
t.goto(175,-205)
t.pendown()
t.color("black","black")
t.begin_fill()
t.left(90)
t.fd(95)
t.left(75)
t.fd(20)
t.left(105)
t.fd(95)
t.end_fill()
t.penup()
t.goto(-175,-205)
t.pendown()
t.color("black","black")
t.begin_fill()
t.right(180)
t.fd(95)
t.right(75)
t.fd(20)
t.right(105)
t.fd(95)
t.end_fill()

 

这篇关于使用Python turtle 库画学校大门的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!