turtle库绘制简易沙雕表情
#drawExpression.py
import turtle
def eye():
turtle.begin_fill()
turtle.circle(-65,134.8)
turtle.fillcolor("#FFFFFF")#白色
turtle.end_fill()
turtle.right(112.6)
turtle.fd(60)
turtle.begin_fill()
turtle.pencolor("#000000")#黑色
turtle.fillcolor("#000000")#黑色
turtle.circle(-10)
turtle.end_fill()
turtle.penup()
turtle.bk(20)
turtle.pencolor("#9C661F")#砖红色
turtle.pendown()
turtle.fd(80)
return turtle.position()
turtle.setup(900,600,200,200)
turtle.speed(10)
turtle.penup()
turtle.pensize(5)
turtle.right(90)
turtle.fd(100)
turtle.left(90)
turtle.pendown()
#draw face
turtle.begin_fill()
turtle.pencolor("#9C661F")#砖红色
turtle.circle(150)
turtle.fillcolor("#FFFF00")#黄色
turtle.end_fill()
#draw mouth
turtle.penup()
turtle.pencolor("#9C661F")#砖红色
turtle.left(90)
turtle.fd(150)
turtle.right(90)
turtle.fd(125)
turtle.right(90)
turtle.pendown()
turtle.circle(-125,180)
#draw left eye
turtle.penup()
turtle.fd(50)
turtle.right(90)
turtle.pencolor("#9C661F")#砖红色
turtle.fd(120)
turtle.setheading(-112.6)
turtle.down()
eye()
#draw right eye
turtle.penup()
turtle.pencolor("#9C661F")#砖红色
turtle.fd(10)
turtle.fd(120)
turtle.setheading(-112.6)
turtle.pendown()
eye()
#end
turtle.hideturtle()
turtle.done()