python画狗头表情包
时间: 2023-12-12 15:35:51 浏览: 232
以下是用Python画狗头表情包的代码和步骤:
```python
import turtle
# 设置画布大小和背景颜色
turtle.setup(800, 800)
turtle.bgcolor("#FEE7A0")
# 画头部
turtle.pensize(5)
turtle.penup()
turtle.goto(0, -200)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("#F5B7B1")
turtle.circle(200)
turtle.end_fill()
# 画耳朵
turtle.penup()
turtle.goto(-100, 150)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("#F5B7B1")
turtle.right(45)
turtle.circle(100, -90)
turtle.left(45)
turtle.circle(100, -90)
turtle.end_fill()
turtle.penup()
turtle.goto(100, 150)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("#F5B7B1")
turtle.left(45)
turtle.circle(-100, -90)
turtle.right(45)
turtle.circle(-100, -90)
turtle.end_fill()
# 画眼睛
turtle.penup()
turtle.goto(-70, 50)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("#FFFFFF")
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.goto(70, 50)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("#FFFFFF")
turtle.circle(50)
turtle.end_fill()
turtle.penup()
turtle.goto(-50, 70)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("#000000")
turtle.circle(20)
turtle.end_fill()
turtle.penup()
turtle.goto(50, 70)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("#000000")
turtle.circle(20)
turtle.end_fill()
# 画鼻子
turtle.penup()
turtle.goto(0, 0)
turtle.pendown()
turtle.begin_fill()
turtle.fillcolor("#000000")
turtle.circle(30)
turtle.end_fill()
# 画嘴巴
turtle.penup()
turtle.goto(-100, -100)
turtle.pendown()
turtle.pensize(10)
turtle.right(90)
turtle.circle(100, 180)
# 隐藏画笔
turtle.hideturtle()
# 显示绘图窗口
turtle.done()
```
阅读全文