py用turtle画初音未来的代码
时间: 2023-03-24 11:02:50 浏览: 345
我可以回答这个问题。以下是用 Python 的 turtle 模块画初音未来的代码:
```python
import turtle
# 设置画布大小和背景颜色
turtle.setup(800, 600)
turtle.bgcolor("#FFF")
# 设置画笔颜色和粗细
turtle.pensize(4)
turtle.pencolor("#00BFFF")
# 画头发
turtle.penup()
turtle.goto(-100, 200)
turtle.pendown()
turtle.circle(100, 180)
turtle.right(180)
turtle.circle(-100, 180)
# 画脸
turtle.penup()
turtle.goto(, )
turtle.pendown()
turtle.circle(200)
# 画眼睛
turtle.penup()
turtle.goto(-80, 80)
turtle.pendown()
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.circle(40)
turtle.end_fill()
turtle.penup()
turtle.goto(80, 80)
turtle.pendown()
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.circle(40)
turtle.end_fill()
turtle.penup()
turtle.goto(-60, 80)
turtle.pendown()
turtle.fillcolor("#000000")
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
turtle.penup()
turtle.goto(60, 80)
turtle.pendown()
turtle.fillcolor("#000000")
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
# 画嘴巴
turtle.penup()
turtle.goto(-100, -20)
turtle.pendown()
turtle.right(90)
turtle.circle(100, 180)
# 画身体
turtle.penup()
turtle.goto(-200, -200)
turtle.pendown()
turtle.fillcolor("#00BFFF")
turtle.begin_fill()
turtle.forward(400)
turtle.right(90)
turtle.circle(200, 180)
turtle.right(90)
turtle.forward(400)
turtle.end_fill()
# 画腿
turtle.penup()
turtle.goto(-100, -200)
turtle.pendown()
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.forward(100)
turtle.right(90)
turtle.forward(200)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(200)
turtle.end_fill()
turtle.penup()
turtle.goto(, -200)
turtle.pendown()
turtle.fillcolor("#FFFFFF")
turtle.begin_fill()
turtle.forward(100)
turtle.right(90)
turtle.forward(200)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(200)
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)