美文网首页
用python的turtle模块画个太极图

用python的turtle模块画个太极图

作者: 半道出了个家 | 来源:发表于2020-05-11 15:54 被阅读0次
太极
import turtle
pony = turtle.Turtle()
# 设置前后景色
pony.pencolor('black')
pony.fillcolor('black')

pony.begin_fill()
pony.circle(100,180)
pony.circle(50,-180)
pony.left(180)
pony.circle(50,180)
pony.end_fill()
pony.circle(100,-180)

pony.penup()
pony.left(90)
pony.forward(50)
pony.pendown()
pony.begin_fill()
pony.dot(30)
pony.end_fill()

pony.penup()
pony.forward(100)
pony.pendown()
pony.pencolor('white')
pony.begin_fill()
pony.dot(30)
pony.end_fill()
# 隐藏画笔
pony.hideturtle()
turtle.done()

相关文章

网友评论

      本文标题:用python的turtle模块画个太极图

      本文链接:https://www.haomeiwen.com/subject/foiunhtx.html