用简单python画hello kitty
时间: 2023-07-12 08:28:05 浏览: 2175
好的,以下是用Python绘制Hello Kitty的代码:
```python
import turtle
# 设置画布和画笔
canvas = turtle.Screen()
canvas.bgcolor("#F7A9A8")
brush = turtle.Turtle()
brush.speed(10)
# 绘制头部
brush.color("#FFFFFF")
brush.begin_fill()
brush.circle(100)
brush.end_fill()
# 绘制脸部轮廓
brush.penup()
brush.goto(-70, 40)
brush.pendown()
brush.color("#000000")
brush.pensize(4)
brush.right(20)
brush.circle(80, 150)
brush.right(120)
brush.circle(80, 150)
# 绘制眼睛
brush.penup()
brush.goto(-35, 120)
brush.pendown()
brush.begin_fill()
brush.circle(20)
brush.end_fill()
brush.penup()
brush.goto(35, 120)
brush.pendown()
brush.begin_fill()
brush.circle(20)
brush.end_fill()
# 绘制眼珠
brush.penup()
brush.goto(-30, 125)
brush.pendown()
brush.color("#FFFFFF")
brush.begin_fill()
brush.circle(8)
brush.end_fill()
brush.penup()
brush.goto(40, 125)
brush.pendown()
brush.begin_fill()
brush.circle(8)
brush.end_fill()
# 绘制鼻子
brush.penup()
brush.goto(0, 80)
brush.pendown()
brush.begin_fill()
brush.circle(15)
brush.end_fill()
# 绘制嘴巴
brush.penup()
brush.goto(-60, 30)
brush.pendown()
brush.right(60)
brush.circle(80, 120)
# 绘制腮红
brush.penup()
brush.goto(-95, 20)
brush.pendown()
brush.color("#F5A9A8")
brush.begin_fill()
brush.circle(15)
brush.end_fill()
brush.penup()
brush.goto(95, 20)
brush.pendown()
brush.begin_fill()
brush.circle(15)
brush.end_fill()
# 绘制蝴蝶结
brush.penup()
brush.goto(-70, -20)
brush.pendown()
brush.color("#FF00FF")
brush.begin_fill()
brush.circle(30, 180)
brush.right(90)
brush.forward(60)
brush.right(90)
brush.circle(-30, 180)
brush.end_fill()
# 隐藏画笔
brush.hideturtle()
turtle.done()
```
运行以上代码,即可在画布上看到绘制的Hello Kitty!
阅读全文
相关推荐
















