python turtle 海龟绘图小恐龙(《小猪佩奇》里的)

使用python turtle库,初学者尝试绘制《小猪佩奇》中的小恐龙形象,虽然与原图有出入,但作为初次尝试已颇具形似,鼓励继续努力。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在这里插入图片描述

python零基础 turtle库绘制《小猪佩奇》里的小恐龙

python代码

#dinosaur.py

import turtle as t

#龙身
t.setup(1000,600)               # 设置画布的大小
t.speed(10)                     # 设置画笔速度为10
t.pensize(5)                    # 设置画笔大小
t.pencolor("SpringGreen4")      # 设置画笔颜色
t.penup()         # 提笔
t.goto(250,180)   # 画笔前往坐标(250,180)
t.begin_fill()    # 准备填充
t.pendown()       # 落笔
t.seth(120)       # 画笔角度为120°
t.circle(100,140) # 画一个半径为100,角度为140°的圆
t.seth(-96)
t.fd(120)         # 向前移动120
t.circle(-100,50)
t.circle(-80,23)
t.seth(176)
t.fd(20)
t.seth(180)
t.circle(-315,40)
t.seth(270)
t.circle(50,30)
t.circle(10,3)
t.seth(-60)
t.circle(180,40)
t.circle(500,20)
t.circle(750,8)
t.circle(80,60)
t.circle(70,30)
t.fd(90)
t.circle(-80,30)
t.seth(10)
t.fd(60)
t.seth(160)
t.fd(90)
t.seth(22)
t.fd(89)
t.color("LightGreen")       # 设置填充颜色
#t.color('SpringGreen1')
t.end_fill()                # 依据轮廓填充

在这里插入图片描述

#龙眼
t.pensize(5)
t.pencolor("SpringGreen4")
t.penup()
t.goto(128,165)
t.pendown()
t.begin_fill()
t.seth(
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值