用Python绘制沙雕表情包

今天带大家绘制一个沙雕小人
用海龟库实现
整体还是比较简单的
就是定位麻烦一点
代码如下:

import turtle as t

t.speed(2)
t.pensize(2)
# 脸
t.circle(200, 30)
t.circle(100, 60)
t.circle(200, 40)
# print(t.pos())
t.pu()
t.goto(75, 265)
t.pd()
t.seth(150)
t.circle(170, 55)

t.pu()
t.goto(0, 0)
t.pd()
t.seth(0)
t.circle(200, -30)
t.circle(100, -60)
t.circle(200, -40)
# print(t.pos())

# 耳朵
t.seth(115)
t.circle(-200, 15)
# print(t.pos())
t.right(130)
t.circle(200, 15)

t.pu()
t.goto(103, 241)
t.pd()

t.seth(90)
t.circle(-200, 15)
# print(t.pos())
t.right(-130)
t.circle(200, 15)

t.pu()
t.goto(-110,280)
t.pd()
t.seth(115+180)
t.circle(200, 10)

t.pu()
t.goto(100,280)
t.pd()
t.seth(-130)
t.circle(200, 10)

# 领子
t.pu()
t.goto(0, 0)
t.pd()
t.goto(-20, -20)
t.goto(-60, 11)
t.pu()
t.goto(0, 0)
t.pd()
t.goto(20, -20)
t.goto(60, 11)

# 身子
t.pu()
t.goto(80, 16)
t.pd()
t.seth(180-50)
t.circle(200, -40)
t.pu()
t.goto(-80, 16)
t.pd()
t.seth(180+50)
t.circle(200, 40)

# 五官
t.pu()
t.goto(-80, 150)
t.pd()
t.write('你最', font=('楷体', 60))
t.pu()
t.goto(-80, 75)
t.pd()
t.write('漂亮', font=('楷体', 60))


t.done()

效果图:
在这里插入图片描述
一起学习python,小白指导,教学分享记得私信我

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Miku丨无形

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值