py用turtle画初音未来的代码
时间: 2023-03-24 19:02:51 浏览: 372
我可以回答这个问题。以下是用 Python 的 turtle 模块画初音未来的代码:
```python
import turtle
# 设置画布大小和背景颜色
turtle.setup(800, 600)
turtle.bgcolor("#FDD7E4")
# 画头发
turtle.penup()
turtle.goto(-100, 200)
turtle.pendown()
turtle.pensize(20)
turtle.pencolor("#39C5BB")
turtle.circle(-50, 180)
turtle.circle(-10, 180)
turtle.circle(-50, 180)
# 画脸
turtle.penup()
turtle.goto(, )
turtle.pendown()
turtle.pensize(20)
turtle.pencolor("#FDD7E4")
turtle.circle(150)
# 画眼睛
turtle.penup()
turtle.goto(-60, 100)
turtle.pendown()
turtle.pensize(10)
turtle.pencolor("#000000")
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill()
turtle.penup()
turtle.goto(60, 100)
turtle.pendown()
turtle.pensize(10)
turtle.pencolor("#000000")
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill()
turtle.penup()
turtle.goto(-60, 120)
turtle.pendown()
turtle.pensize(5)
turtle.pencolor("#000000")
turtle.fillcolor("#000000")
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
turtle.penup()
turtle.goto(60, 120)
turtle.pendown()
turtle.pensize(5)
turtle.pencolor("#000000")
turtle.fillcolor("#000000")
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
# 画嘴巴
turtle.penup()
turtle.goto(-80, )
turtle.pendown()
turtle.pensize(10)
turtle.pencolor("#000000")
turtle.right(90)
turtle.circle(80, 180)
# 画身体
turtle.penup()
turtle.goto(-150, -150)
turtle.pendown()
turtle.pensize(20)
turtle.pencolor("#39C5BB")
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.forward(300)
turtle.left(90)
turtle.circle(100, 180)
turtle.forward(300)
turtle.end_fill()
# 画腿
turtle.penup()
turtle.goto(-100, -150)
turtle.pendown()
turtle.pensize(20)
turtle.pencolor("#39C5BB")
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(50)
turtle.end_fill()
turtle.penup()
turtle.goto(100, -150)
turtle.pendown()
turtle.pensize(20)
turtle.pencolor("#39C5BB")
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(50)
turtle.end_fill()
# 结束
turtle.done()
```
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)