小猪佩奇python_一段代码画出小猪佩奇社会人 Python
复制内容到剪贴板
代码:# coding:utf-8
import turtle as t
t.pensize(4)
t.hideturtle()
t.colormode(255)
t.color((255,155,192),"pink")
t.setup(840,500)
t.speed(10)
#鼻子
t.pu()
t.goto(-100,100)
t.pd()
t.seth(-30)
t.begin_fill()
a=0.4
for i in range(120):
if 0<=i<30 or 60<=i<90:
a=a+0.08
t.lt(3) #向左转3度
t.fd(a) #向前走a的步长
else:
a=a-0.08
t.lt(3)
t.fd(a)
t.end_fill()
t.pu()
t.seth(90)
t.fd(25)
t.seth(0)
t.fd(10)
t.pd()
t.pencolor(255,155,192)
t.seth(10)
t.begin_fill()
t.circle(5)
t.color(160,82,45)
t.end_fill()
t.pu()
t.seth(0)
t.fd(20)
t.pd()
t.pencolor(255,155,192)
t.seth(10)
t.begin_fill()
t.circle(5)
t.color(160,82,45)
t.end_fill()
#头
t.color((255,155,192),"pink")
t.pu()
t.seth(90)
t.fd(41)
t.seth(0)
t.fd(0)
t.pd()
t.begin_fill()
t.seth(180)
t.circle(300,-30)
t.circle(100,-60)
t.circle(80,-100)
t.circle(150,-20)
t.circle(60,-95)
t.seth(161)
t.circle(-300,15)
t.pu()
t.goto(-100,100)
t.pd()
t.seth(-30)
a=0.4
for i in range(60):
if 0<=i<30 or 60<=i<90:
a=a+0.08
t.lt(3) #向左转3度
t.fd(a) #向前走a的步长
else:
a=a-0.08
t.lt(3)
t.fd(a)
t.end_fill()
#耳朵
t.color((255,155,192),"pink")
t.pu()
t.seth(90)
t.fd(-7)
t.seth(0)
t.fd(70)
t.pd()
t.begin_fill()
t.seth(100)
t.circle(-50,50)
t.circle(-10,120)
t.circle(-50,54)
t.end_fill()
t.pu()
t.seth(90)
t.fd(-12)
t.seth(0)
t.fd(30)
t.pd()
t.begin_fill()
t.seth(100)
t.circle(-50,50)
t.circle(-10,120)
t.circle(-50,56)
t.end_fill()
#眼睛
t.color((255,155,192),"white")
t.pu()
t.seth(90)
t.fd(-20)
t.seth(0)
t.fd(-95)
t.pd()
t.begin_fill()
t.circle(15)
t.end_fill()
t.color("black")
t.pu()
t.seth(90)
t.fd(12)
t.seth(0)
t.fd(-3)
t.pd()
t.begin_fill()
t.circle(3)
t.end_fill()
t.color((255,155,192),"white")
t.pu()
t.seth(90)
t.fd(-25)
t.seth(0)
t.fd(40)
t.pd()
t.begin_fill()
t.circle(15)
t.end_fill()
t.color("black")
t.pu()
t.seth(90)
t.fd(12)
t.seth(0)
t.fd(-3)
t.pd()
t.begin_fill()
t.circle(3)
t.end_fill()
#腮
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(-95)
t.seth(0)
t.fd(65)
t.pd()
t.begin_fill()
t.circle(30)
t.end_fill()
#嘴
t.color(239,69,19)
t.pu()
t.seth(90)
t.fd(15)
t.seth(0)
t.fd(-100)
t.pd()
t.seth(-80)
t.circle(30,40)
t.circle(40,80)
#身体
t.color("red",(255,99,71))
t.pu()
t.seth(90)
t.fd(-20)
t.seth(0)
t.fd(-78)
t.pd()
t.begin_fill()
t.seth(-130)
t.circle(100,10)
t.circle(300,30)
t.seth(0)
t.fd(230)
t.seth(90)
t.circle(300,30)
t.circle(100,3)
t.color((255,155,192),(255,100,100))
t.seth(-135)
t.circle(-80,63)
t.circle(-150,24)
t.end_fill()
#手
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(-40)
t.seth(0)
t.fd(-27)
t.pd()
t.seth(-160)
t.circle(300,15)
t.pu()
t.seth(90)
t.fd(15)
t.seth(0)
t.fd(0)
t.pd()
t.seth(-10)
t.circle(-20,90)
t.pu()
t.seth(90)
t.fd(30)
t.seth(0)
t.fd(237)
t.pd()
t.seth(-20)
t.circle(-300,15)
t.pu()
t.seth(90)
t.fd(20)
t.seth(0)
t.fd(0)
t.pd()
t.seth(-170)
t.circle(20,90)
#脚
t.pensize(10)
t.color((240,128,128))
t.pu()
t.seth(90)
t.fd(-75)
t.seth(0)
t.fd(-180)
t.pd()
t.seth(-90)
t.fd(40)
t.seth(-180)
t.color("black")
t.pensize(15)
t.fd(20)
t.pensize(10)
t.color((240,128,128))
t.pu()
t.seth(90)
t.fd(40)
t.seth(0)
t.fd(90)
t.pd()
t.seth(-90)
t.fd(40)
t.seth(-180)
t.color("black")
t.pensize(15)
t.fd(20)
#尾巴
t.pensize(4)
t.color((255,155,192))
t.pu()
t.seth(90)
t.fd(70)
t.seth(0)
t.fd(95)
t.pd()
t.seth(0)
t.circle(70,20)
t.circle(10,330)
t.circle(70,30)
t.done()
小猪佩奇python_一段代码画出小猪佩奇社会人 Python相关推荐
- python画图小猪佩奇_吊炸天!Python 20秒画出小猪佩奇
原标题:吊炸天!Python 20秒画出小猪佩奇 今年社交平台上的带货女王是谁?范冰冰?杨幂?Angelababy?不,是猪猪女孩小猪佩奇. 小猪佩奇在构图基本是各种曲线,类抛物线.类圆.类椭圆.类二 ...
- python简笔画程序_社会了,教小白如何用Python画出小猪佩琪!
今天南鸢带来了许多小朋友都喜欢的小猪佩奇简笔画教程哦,有许多妈妈都不知道小猪佩奇是怎样画出来的呢,下面就和南鸢一起进入小猪佩奇的简笔画教程吧(先不告诉大家南鸢会Python). 一.第一步,我们可以纸 ...
- python动态爱心曲线_python代码画出爱心曲线
Python的拿手好戏是解决数据分析和可视化问题,本篇文章给大家分享的是python代码画出爱心曲线的操作详解,内容挺不错的,希望可以帮助到有需要的朋友. 先不急着画爱心线,来看如何画函数曲线. 例如 ...
- 2022世界杯的呈现:用简单的python代码画出
世界杯是足球界最重要的盛会,每四年举办一次,吸引了全世界的目光.作为一名程序员,我希望通过代码的方式来呈现这一盛事. 下面是用 Python 的绘图库来画出一个足球的代码: import matplo ...
- 神级程序员8000行css代码画出一个蒙娜丽莎,堪比达芬奇!
代码画出的蒙娜丽莎 今天逛CODEPEN找HTML5动画案例的时候,偶尔看到一位神级大师的作品,用纯CSS代码画出一副蒙娜丽莎,虽然分辨率不高,但是仍然让我很是震撼,一看代码,整整8000行,基本一行 ...
- 用Python代码画出灰太狼
文章目录 简介 代码 运行效果 备注 简介 用python代码画出灰太狼,仅使用turtle库.如下: 绘画过程可以在下列平台查看: 抖音:用代码画灰太狼,不是一个合格的狼,但一定是合格的丈夫和父亲 ...
- 用Python代码画出麻衣学姐
文章目录 简介 代码 运行效果 备注 简介 用python代码画出麻衣学姐,仅使用turtle库.如下: 绘画过程可以在下列平台查看: 抖音:只需35秒!就可代码画出麻衣学姐! b站:只需35秒!就可 ...
- python画出小猪佩奇
作为一个python的学习者,让我萌生了用python画社会人的想法. 看这个图像可以发现,佩奇由各种曲线.类抛物线.类圆.类椭圆等组成.这里提到的"类",是小猪佩奇的构图精髓,一 ...
- python绘图turtle小猪_turtle作图:用turtle画一个小猪佩奇(详解!)
之前的一篇文章大致说了一下turtle这个模块的基本操作,不知道的朋友可以去看看,真的超级简单:python:turtle作图基础. 准备用turtle来画一个网红猪--小猪佩奇. 在这之前,我们先聊 ...
最新文章
- python数字类型-Python数字类型及其操作
- 数组计算的数学模块----NumPy
- 【SpringBoot2 从0开始】开发小技巧 - lombok、devtools、Spring Initailizr
- 栈实现10进制到8进制的转换
- 在DataList、Repeater的HeaderTemplate和FooterTemplate模板中寻找控件FindControl
- Wpf中显示Unicode字符
- PIFA-平面倒F天线[搬运]
- 【嵌入式】基于ARM的嵌入式Linux开发总结
- icom对讲机写频线定义_ICOM对讲机的常见故障和使用中的问题
- 基于cropper.js封装vue在线图片裁剪组件
- 科技爱好者周刊(第 167 期):广告拦截器太过分了
- leet 75. 颜色分类
- 多源异构数据分析为什么需要数据湖?
- 深度学习(二、全连接网络FNN)
- 我愿称之为最强归纳—浮点数的规格化与进制数之间的转换
- Java Map 接口详解
- Ubuntu卸载预装
- 安陆唐明惠 不堪回首的高考
- Python:批量读取目录下jpg文件,并输出jpg文件的绝对路径到指定txt文档中。
- 龙泉驿区!成都经开区支持扩大汽车消费政策申报条件时间及认定奖励补助
热门文章
- wxWidgets:wxPowerEvent类用法
- wxWidgets:wxFilePickerCtrl类用法
- wxWidgets:wxDCClipper类用法
- boost::safe_numerics模块实现隐式转换更改数据值的测试程序
- boost::python::converter::as_to_python_function相关的测试程序
- boost::polygon::detail::robust_fpt相关的测试程序
- boost::outcome_v2::std_result用法的测试程序
- boost::histogram::axis::option用法的测试程序
- boost::remove_edge用法的测试程序
- ITK:使用GMM EM分配像素