python/test.py

38 lines
694 B
Python

import turtle
t=turtle.Turtle()
t.speed(0)
t.color("red","red")
t.begin_fill()
t.penup
t.goto(-300,200)
t.pendown
t.goto(300,200)
t.goto(300,-200)
t.goto(-300,-200)
t.goto(-300,200)
t.end_fill()
def hua(size,x,y,angle=0):
t.penup()
t.goto(x,y)
t.setheading(angle)
t.pendown()
t.color("yellow","yellow")
t.begin_fill()
for i in range(5):
t.forward(size)
t.right(144)
t.forward(size)
t.left(72)
t.end_fill()
hua(30, -250, 150)
hua(9, -150, 180, 30)
hua(9, -130, 130, 45)
hua(9, -140, 80, 0)
hua(9, -200, 50, -30)
t.penup()
t.goto(0,-300)
t.pencolor("black")
t.pendown()
t.write('中国',font=("楷体","20","normal"))
turtle.done()