python海龟画哆啦a梦_python 海龟绘图画哆啦A梦

这篇博客通过Python的turtle库详细演示了如何画出哆啦A梦的完整过程,包括定位、眼睛、胡须、手、脚、头部、身体、表情等各个部分的绘制方法,展现了turtle库在图形创作上的应用。
摘要由CSDN通过智能技术生成

import turtle as t

#定位

def my_goto(x,y):

t.up()

t.goto(x,y)

t.down()

#眼睛

def eyes():

t.tracer(False)

a = 2.5

for i in range(120):

if 0

a -= 0.05

t.lt(3)

t.fd(a)

else:

a += 0.05

t.lt(3)

t.fd(a)

t.tracer(True)

#胡须

def beard(x,y,s,f):

my_goto(x, y)

t.seth(s)

t.fd(f)

#画手

def hand(s,color,c):

t.seth(s)

t.fillcolor(color)

t.begin_fill()

t.circle(c)

t.end_fill()

#画脚

def foot(x,y,s,color,f1,c1,c2,f2,c3,c4,f4):

my_goto(x, y)

t.seth(s)

t.fillcolor(color)

t.begin_fill()

t.fd(f1)

t.circle(c1, c2)

t.fd(f2)

t.circle(c3, c4)

t.fd(f4)

t.end_fill()

#头

t.p

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值