python turtle绘制跪坐的哭泣小人
时间: 2023-10-14 19:18:38 浏览: 107
好的,以下是绘制跪坐的哭泣小人的 Python Turtle 代码:
```
import turtle
# 设置画笔参数
turtle.pensize(4)
turtle.pencolor('black')
turtle.speed(10)
# 绘制身体
turtle.fillcolor('#FFE4C4')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
# 绘制膝盖
turtle.penup()
turtle.goto(-20, -70)
turtle.pendown()
turtle.fillcolor('#FFE4C4')
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
turtle.penup()
turtle.goto(20, -70)
turtle.pendown()
turtle.fillcolor('#FFE4C4')
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
# 绘制眼睛
turtle.penup()
turtle.goto(-20, 20)
turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
turtle.penup()
turtle.goto(-20, 25)
turtle.pendown()
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(5)
turtle.end_fill()
turtle.penup()
turtle.goto(20, 20)
turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
turtle.penup()
turtle.goto(20, 25)
turtle.pendown()
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(5)
turtle.end_fill()
# 绘制嘴巴
turtle.penup()
turtle.goto(-30, -20)
turtle.pendown()
turtle.right(45)
turtle.circle(30, 90)
turtle.penup()
turtle.goto(-30, -20)
turtle.pendown()
turtle.left(90)
turtle.circle(-30, 90)
# 绘制眼泪
turtle.penup()
turtle.goto(-35, 5)
turtle.pendown()
turtle.pencolor('blue')
turtle.right(45)
turtle.circle(10, 90)
turtle.penup()
turtle.goto(35, 5)
turtle.pendown()
turtle.left(90)
turtle.circle(-10, 90)
# 完成绘制
turtle.done()
```
运行上述代码后,即可看到跪坐的哭泣小人的图像。
阅读全文