Python教程44:海龟画图turtle画卡塔尔世界杯吉祥物

---------------turtle源码集合---------------

Python教程42:海龟画图turtle画海绵宝宝

Python教程41:海龟画图turtle画蜡笔小新

Python教程40:使用turtle画一只杰瑞

Python教程39:使用turtle画美国队长盾牌

Python教程38:使用turtle画动态粒子爱心+文字爱心

Python教程37:使用turtle画一个戴帽子的皮卡丘

Python教程36:海龟画图turtle写春联

Python源码35:海龟画图turtle画中国结

Python源码31:海龟画图turtle画七道彩虹

Python源码30:海龟画图turtle画紫色的小熊

Python源码29:海龟画图turtle画太极图

Python源码28:海龟画图turtle画熊猫

Python源码27:海龟画图turtle画动态圆舞曲

Python源码26:海龟画图turtle画向日葵

Python源码25:海龟画图turtle画小猪佩奇

Python源码24:使用海龟画图turtle画滑板

Python源码23:使用海龟画图turtle画小狗狗

Python源码22:使用海龟画图turtle画今天日期

Python源码21:使用海龟画图turtle画太阳,云朵,房子,绿树

Python源码20:使用海龟画图turtle画一个会动的星空

Python源码19:海龟画图turtle画螺旋的彩色的逐渐放大的文字

Python源码18:使用海龟画图turtle画捂脸表情

Python源码17:使用海龟画图turtle画五星红旗

Python源码16:使用海龟画图turtle画会动的时钟

Python源码15:使用海龟画图turtle画小黄人

Python源码14:使用海龟画图turtle画我的城堡

Python源码分享13:使用海龟画图turtle画一个会眨眼的皮卡丘

Python源码分享12:使用turtle画彩色六边形

Python源码分享11:使用海龟画图turtle画航天火箭

Python源码分享10:使用海龟画图turtle画哆啦A梦

Python源代码分享:02海龟画图五角星

Python源代码分享:03画一个奥运五环图

Python源代码分享:05使用turtle模块绘制一个彩色螺旋图案

Python源代码分享:07画满天繁星

Python源码分享08:使用turtle画一朵玫瑰花

Python源码分享10:使用海龟画图turtle画哆啦A梦

Python源码分享11:使用海龟画图turtle画航天火箭

Python源码分享12:使用turtle画彩色六边形
在这里插入图片描述

# @Author : 小红牛
# 微信公众号:WdPython
import turtle as t
# 设置背景颜色,窗口位置以及大小

t.colormode(255)  # 颜色模式
t.speed(0)
t.screensize(800, 700, "black")  # 画布大小背景颜色
t.setup(width=800, height=700, startx=None, starty=None)  # 绘图窗口的大小和起始坐标

t.title('2022卡塔尔世界杯吉元素!')  # 设置绘图窗口的标题
t.resizemode('noresize')  # 大小调整模式:auto,user,noresize
t.tracer(1)
t.hideturtle()


def mlingpen(x, y):
    t.penup()
    t.goto(x, y)
    t.pendown()


def mlingfacecheek(x, y, fx):
    mlingpen(x, y)
    t.seth(fx)
    t.pencolor("#fcd1ae")
    t.fillcolor('#fcd1ae')
    t.begin_fill()
    n = 1.8
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            n -= 0.05
            t.left(3)
            t.fd(n)
        else:
            n += 0.05
            t.left(3)
            t.fd(n)
    t.end_fill()


def mlingfacecheek_h(x, y, fx):
    mlingpen(x, y)
    t.seth(fx)
    t.pencolor("#fcc6ae")
    t.fillcolor('#fcc6ae')
    t.begin_fill()
    n = 1.6
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            n -= 0.06
            t.left(3)
            t.fd(n)
        else:
            n += 0.06
            t.left(3)
            t.fd(n)
    t.end_fill()


def mlingellipse(x, y, jiajiao, l, size, color1, color2):
    mlingpen(x, y)
    t.seth(jiajiao + 270)
    t.pensize(size)
    t.pencolor(color1)
    t.fillcolor(color2)
    t.pendown()
    t.begin_fill()
    a = 0.3
    for i in range(120):
        if 0 <= i < 30 or 60 <= i < 90:
            a += l
            t.lt(3)
            t.fd(a)
        else:
            a -= l
            t.lt(3)
            t.fd(a)
    t.penup()
    t.end_fill()


def mlingrotate_left(chishu, angle, length):
    for i in range(chishu):
        t.left(angle)
        t.forward(length)


def mlingrotate_right(chishu, angle, length):
    for i in range(chishu):
        t.right(angle)
        t.forward(length)


def llaeebeye():
    # AdversityAwake
    t.seth(22)
    mlingpen(80, 62)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    t.begin_fill()
    t.circle(40, 62)
    t.circle(21, 160)
    t.circle(40, 53)
    t.goto(80, 62)
    t.end_fill()
    t.seth(20)
    mlingpen(80, 62)
    t.pensize(2)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.circle(35, 62)
    t.circle(20, 164)
    t.circle(40, 53)
    t.goto(80, 62)
    t.end_fill()
    t.seth(30)
    mlingpen(76, 65)
    t.pensize(3)
    t.pencolor("#452b14")
    t.fillcolor('#e58f59')
    t.begin_fill()
    t.circle(31, 90)
    t.lt(12)
    t.circle(12, 70)
    t.lt(27)
    t.circle(40, 68)
    t.goto(76, 65)
    t.end_fill()
    t.seth(0)
    mlingpen(66, 72)
    t.pensize(1)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    t.begin_fill()
    t.circle(20, 120)
    t.circle(10, 120)
    t.lt(6)
    t.circle(40, 40)
    t.goto(66, 72)
    t.end_fill()
    t.seth(0)
    mlingpen(68, 75)
    t.pencolor("#373331")
    t.fillcolor('#3f3a38')
    t.begin_fill()
    t.circle(5, 360)
    t.end_fill()
    t.seth(0)
    mlingpen(73, 102)
    t.pensize(1)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.circle(6, 360)
    t.end_fill()
    # AdversityAwake
    t.seth(40)
    mlingpen(10, 70)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    t.begin_fill()
    t.circle(30, 170)
    t.circle(23, 120)
    t.goto(10, 70)
    t.end_fill()
    t.seth(44)
    mlingpen(10, 70)
    t.pensize(2)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.circle(29, 170)
    t.circle(23, 100)
    t.goto(10, 70)
    t.end_fill()
    t.seth(30)
    mlingpen(0, 75)
    t.pensize(3)
    t.pencolor("#452b14")
    t.fillcolor('#e58f59')
    t.begin_fill()
    t.circle(23, 280)
    t.goto(0, 75)
    t.end_fill()
    t.seth(30)
    mlingpen(-3, 82)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    t.begin_fill()
    t.circle(15, 360)
    t.goto(-3, 82)
    t.end_fill()
    t.seth(0)
    mlingpen(-11, 82)
    t.pencolor("#373331")
    t.fillcolor('#3f3a38')
    t.begin_fill()
    t.circle(5, 360)
    t.end_fill()
    t.seth(0)
    mlingpen(-6, 102)
    t.pensize(1)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.circle(6, 360)
    t.end_fill()


def llaeebmeim():
    t.seth(100)
    mlingpen(-30, 125)
    t.pensize(2)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    t.begin_fill()
    t.goto(25, 133)
    t.circle(10, 100)
    t.rt(30)
    t.circle(50, 60)
    t.goto(-30, 125)
    t.end_fill()
    # AdversityAwake
    t.seth(120)
    mlingpen(60, 130)
    t.pensize(2)
    t.pencolor("#000000")
    t.fillcolor('#000000')
    t.begin_fill()
    t.goto(106, 130)
    t.circle(30, 40)
    t.circle(25, 80)
    t.goto(60, 130)
    t.end_fill()


def llaeebmouse():
    # AdversityAwake
    t.seth(-30)
    mlingpen(0, 55)
    t.pensize(3)
    t.pencolor("#000000")
    # t.begin_fill()
    t.circle(130, 16)
    t.circle(48, 40)
    # t.end_fill()


def llaeebbozi():
    # AdversityAwake
    t.seth(120)
    mlingpen(145, 40)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#805d57')
    t.begin_fill()
    t.circle(12, 120)
    t.rt(30)
    t.circle(55, 17)
    t.rt(10)
    t.circle(-110, 70)
    t.circle(100, 50)
    t.circle(50, 45)
    t.goto(-140, -210)
    t.goto(110, -210)
    t.lt(120)
    t.circle(100, 60)
    t.goto(145, 40)
    t.end_fill()


def llaeebyifu():
    t.seth(160)
    mlingpen(-70, 140)
    t.pencolor("#624655")
    t.pensize(6)
    t.circle(170, 20)
    t.circle(30, 95)
    t.dot(15, "#624655")
    t.seth(-100)
    mlingpen(-70, 140)
    t.circle(-30, 130)
    t.dot(15, "#624655")
    t.seth(-180)
    mlingpen(-70, 140)
    t.circle(30, 50)
    t.circle(-190, 20)
    t.circle(190, 20)
    t.circle(-30, 50)
    t.dot(15, "#624655")
    t.seth(190)
    mlingpen(-70, 140)
    t.circle(-250, 20)
    t.circle(250, 10)
    t.circle(-30, 50)
    t.dot(15, "#624655")
    # AdversityAwake
    t.seth(0)
    mlingpen(-140, -210)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.goto(110, -210)
    t.circle(100, 60)
    t.lt(20)
    t.circle(50, 20)
    t.circle(-50, 30)
    t.circle(80, 60)
    t.goto(100, 140)
    t.rt(20)
    t.circle(80, 60)
    t.circle(100, 60)
    t.circle(190, 10)
    t.rt(15)
    t.circle(290, 55)
    t.goto(-140, -210)
    t.end_fill()


def llaeebhand():
    t.seth(0)
    mlingpen(195, -165)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.lt(75)
    t.circle(50, 20)
    t.circle(-50, 30)
    t.circle(80, 60)
    t.goto(150, 40)
    t.lt(130)
    t.circle(-100, 70)
    t.goto(20, -40)
    t.lt(105)
    t.circle(200, 60)
    t.goto(195, -165)
    t.end_fill()
    t.seth(0)
    mlingpen(190, -160)
    t.pensize(2)
    t.pencolor("#eee7f1")
    t.fillcolor('#eee7f1')
    t.begin_fill()
    t.lt(75)
    t.circle(50, 20)
    t.circle(-50, 30)
    t.circle(80, 60)
    t.goto(147, 25)
    t.lt(130)
    t.circle(-100, 20)
    t.end_fill()
    t.seth(0)
    mlingpen(185, -160)
    t.pensize(2)
    t.pencolor("#faf4fc")
    t.fillcolor('#faf4fc')
    t.begin_fill()
    t.lt(75)
    t.circle(50, 20)
    t.circle(-50, 30)
    t.circle(75, 55)
    t.goto(145, 21)
    t.lt(130)
    t.circle(-95, 30)
    t.end_fill()
    t.seth(0)
    mlingpen(185, -160)
    t.pensize(2)
    t.pencolor("#fdfafe")
    t.fillcolor('#fdfafe')
    t.begin_fill()
    t.lt(75)
    t.circle(45, 20)
    t.circle(-45, 30)
    t.circle(65, 55)
    t.goto(143, 13)
    t.lt(130)
    t.circle(-95, 30)
    t.end_fill()
    # AdversityAwake
    t.seth(-80)
    mlingpen(-127.85, 12.90)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#ffffff')
    t.begin_fill()
    t.circle(46, 55)
    t.lt(60)
    t.circle(-30, 40)
    t.lt(10)
    t.circle(-150, 30)
    t.goto(20, -40)
    t.goto(110, -5)
    t.circle(-8, 80)
    t.lt(2)
    t.circle(-280, 55)
    t.goto(-140, -210)
    t.rt(89)
    t.circle(-300, 48)
    t.goto(-127.85, 12.90)
    t.end_fill()
    t.seth(-120)
    mlingpen(-101.00, -20.80)
    t.circle(90, 32)
    t.lt(120)
    t.circle(-80, 50)
    t.circle(66, 60)
    mlingpen(40, -80)
    mlingellipse(40, -80, 46, 0.06, 3, "#911a2b", "#dd4159")
    mlingellipse(52, -66, 45, 0.01, 3, "#911a2b", "#ffffff")
    mlingpen(45, -74)
    t.dot(9, "#ffffff")
    mlingpen(46, -60)
    t.dot(9, "#ffffff")
    mlingpen(56, -48)
    t.dot(9, "#ffffff")
    mlingpen(72, -46)
    t.dot(9, "#ffffff")
    mlingpen(59, -75)
    t.dot(9, "#ffffff")
    mlingpen(73, -64)
    t.dot(9, "#ffffff")
    t.pensize(3)
    t.pencolor("#911a2b")
    t.fillcolor('#dd4159')
    t.begin_fill()
    mlingpen(10, -100)
    t.goto(20, -100)
    t.lt(90)
    t.fd(20)
    t.lt(135)
    t.fd(10)
    t.goto(10, -100)
    t.end_fill()
    t.pensize(10)
    mlingpen(100, -80)
    t.goto(110, -85)
    t.pensize(3)
    mlingpen(-50, -35)
    t.goto(-20, -45)
    t.pencolor("#000000")


t.pencolor("#fdfafe")
mlingpen(290, 75)
t.write("吉\n祥\n物\n", align="center", font=("楷体", 18, "normal"))
t.up()


def llaeebtoumao():
    t.seth(0)
    mlingpen(105, 135)
    t.pensize(3)
    t.pencolor("#000000")
    t.fillcolor('#624655')
    t.begin_fill()
    t.circle(10, 155)
    t.rt(90)
    t.circle(8, 90)
    t.lt(8)
    t.circle(270, 38)
    t.lt(5)
    t.circle(8, 100)
    t.rt(90)
    t.circle(10, 100)
    t.lt(110)
    t.circle(-20, 50)
    t.circle(-270, 18)
    t.lt(5)
    t.circle(-250, 18)
    t.goto(105, 135)
    t.end_fill()


if __name__ == '__main__':
    llaeebyifu()
    llaeebbozi()
    llaeebhand()
    llaeebtoumao()
    llaeebmouse()
    llaeebmeim()
    llaeebeye()
    t.done()

完毕!!感谢您的收看

----------★★历史博文集合★★----------
我的零基础Python教程,Python入门篇 进阶篇 视频教程 Py安装py项目 Python模块 Python爬虫 Json Xpath 正则表达式 Selenium Etree CssGui程序开发 Tkinter Pyqt5 列表元组字典数据可视化 matplotlib 词云图 Pyecharts 海龟画图 Pandas Bug处理 电脑小知识office自动化办公 编程工具
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/322270.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

庆祝安科瑞企业微电网智慧能源管理系统生态交流会圆满举办-安科瑞 蒋静

2024年1月12日&#xff0c;安科瑞企业微电网智慧能源管理系统生态交流会顺利举行&#xff0c;本次会议旨在围绕双碳目标&#xff0c;共同探讨如何抓住新机遇、新市场&#xff0c;充分利用安科瑞企业微电网智慧能源的一站式服务&#xff0c;为企业节能、减碳、降本赋能&#xff…

深入类加载机制及底层

深入类加载机制 初识类加载过程 使用某个类时&#xff0c;如果该类的class文件没有加载到内存时&#xff0c;则系统会通过以下三个步骤来对该类进行初始化 1.类的加载&#xff08;Load&#xff09; → 2.类的连接&#xff08;Link&#xff09; → 3.类的初始化&#xff08;In…

element upload 自定义上传 报错Cannot set properties of null (setting ‘status‘)

element upload 自定义上传 报错Cannot set properties of null (setting ‘status’) 问题展示 原因分析 自定义上传方式 fileList 显示一切正常&#xff0c;状态也是成功 文件url通过URL.createObjectURL(file.raw) 进行添加 以下为配置代码 <el-uploadclass"uplo…

Nginx初体验

文章目录 定义正向代理 & 反向代理安装与尝试 之前没怎么用过代理服务器Nginx&#xff0c;主要也是因为没有架构知识&#xff0c;根本不会去部署相关的机器。但是最近公司内部在调试的时候&#xff0c;经常用本机去充当Ngnix代理服务器&#xff0c;由于对这块知识掌握得还不…

Linux网络通信

网络模型 七层模型 四层模型 TCP : 面向连接&#xff0c;可靠的&#xff0c;面向字节流&#xff0c;支持点对点通信。 UDP : 无连接&#xff0c;不可靠&#xff0c;面向数据报文&#xff0c;支持一对一&#xff0c;一对多&#xff0c;多对多。通信原理 常用函数 #include <…

深入理解 go reflect - 要不要传指针

在我们看一些使用反射的代码的时候&#xff0c;会发现&#xff0c;reflect.ValueOf 或 reflect.TypeOf 的参数有些地方使用的是指针参数&#xff0c;有些地方又不是指针参数&#xff0c; 但是好像这两者在使用上没什么区别&#xff0c;比如下面这样&#xff1a; var a 1 v1 :…

学习笔记-数据库概念介绍

一.数据库概述 1.数据库: 存储数据的仓库,本质是一个文件系统. 用户可以对数据库中的数据进行 增加,修改,删除以及查询操作 2.特点 可以结构化存储大量的数据可以有效的保持数据的一致性,完整性读写效率高 3.常用数据库 二.数据库分类及其常用 关系型数据库 指的是二维表格…

肯尼斯·里科《C和指针》第6章 指针(5)概念的练习

肯尼斯里科《C和指针》第6章 指针&#xff08;1&#xff09;-CSDN博客 肯尼斯里科《C和指针》第6章 指针&#xff08;2&#xff09;-CSDN博客 肯尼斯里科《C和指针》第6章 指针&#xff08;3&#xff09;-CSDN博客 肯尼斯里科《C和指针》第6章 指针&#xff08;4&#xff09…

领域驱动设计解决汉诺塔问题-文风批评(1)

DDD领域驱动设计批评文集 做强化自测题获得“软件方法建模师”称号 《软件方法》各章合集 以下文章内容纯属虚构&#xff0c;用来批评某些领域驱动设计文风。后续将挑一些近期的文章作为例子来批评。 ********** 领域驱动设计是革命性的创新&#xff0c;是划时代的洞见。领…

DaisyDisk for mac 中文激活版 可视化磁盘清理工具

DaisyDisk 是一款专为 Mac 设计的磁盘空间分析工具。它以直观、图形化的方式展示硬盘使用情况&#xff0c;帮助用户迅速找到占用空间大的文件和文件夹。通过扫描磁盘&#xff0c;DaisyDisk 生成彩色的扇形图表&#xff0c;每个扇区代表一个文件或文件夹&#xff0c;大小直观反映…

构建基于RHEL9系列(CentOS9,AlmaLinux9,RockyLinux9等)的支持63个常见模块的PHP8.1.20的RPM包

本文适用&#xff1a;rhel9系列&#xff0c;或同类系统(CentOS9,AlmaLinux9,RockyLinux9等) 文档形成时期&#xff1a;2023年 因系统版本不同&#xff0c;构建部署应略有差异&#xff0c;但本文未做细分&#xff0c;对稍有经验者应不存在明显障碍。 因软件世界之复杂和个人能力…

Python 两种多值参数

有时可能需要一个函数中处理的参数的个数是不确定的&#xff0c;就需要使用多值参数 参数名前加上*&#xff0c;代表可以接收元组参数名前加上**&#xff0c;代表可以接收字典 代码&#xff1a; def demo(*args, **kwargs):print(args)print(kwargs)demo(1, 2, 3, 4, 5, nam…

采样次数与频率的关系

采样次数&#xff08;Sampling Points&#xff09; 在给定时间内记录信号值的次数。 假设在1秒内对一个连续信号采样10次&#xff0c;这意味着每0.1秒记录一次信号值。 假设在1秒内对一个连续信号采样100次&#xff0c;这意味着每0.01秒记录一次信号值。 频率&#xff08;Fre…

【昕宝爸爸小模块】守护线程、普通线程、两者之间的区别

➡️博客首页 https://blog.csdn.net/Java_Yangxiaoyuan 欢迎优秀的你&#x1f44d;点赞、&#x1f5c2;️收藏、加❤️关注哦。 本文章CSDN首发&#xff0c;欢迎转载&#xff0c;要注明出处哦&#xff01; 先感谢优秀的你能认真的看完本文&…

创新引领游戏产业:武汉灰京文化的成功之路

随着科技的不断发展&#xff0c;游戏产业已经成为全球最具竞争力和创新性的领域之一。在这个激烈的竞技场上&#xff0c;武汉灰京文化凭借其专业化、创新性和诚信的经营理念迅速崭露头角&#xff0c;成功将自身打造成为游戏产业的巨头。 作为游戏产业的佼佼者&#xff0c;武汉…

【极光系列】Windows安装Mysql8.0版本

【极光系列】Windows安装Mysql8.0版本 一.mysql服务端 下载地址&#xff1a;https://dev.mysql.com/downloads/mysql/ 二.解压二进制包 解压到 E:\mysql-8.0.35-winx64目录下&#xff0c;记住你解压后的目录&#xff0c;后续要使用三.创建my.ini文件 tips&#xff1a;mys…

【数据结构和算法】删除链表的中间节点

其他系列文章导航 Java基础合集数据结构与算法合集 设计模式合集 多线程合集 分布式合集 ES合集 文章目录 其他系列文章导航 文章目录 前言 一、题目描述 二、题解 三、代码 四、复杂度分析 前言 这是力扣的1657题&#xff0c;难度为中等&#xff0c;解题方案有很多种&…

unity C#什么是线程锁,以及使用案例

文章目录 原理1. **互斥**&#xff08;Mutual Exclusion&#xff09;:2. **缓存一致性与内存屏障**&#xff1a;3. **操作系统的支持**&#xff1a;4. **编程语言级别的实现**&#xff1a;5. **避免死锁**&#xff1a;图示 实例1实例2 原理 线程锁的原理主要是为了在多线程环境…

FastAdmin西陆教育系统(xiluEdu)开源代码

应用介绍 一款基于FastAdminThinkPHPUniapp开发的西陆教育系统&#xff08;微信小程序、移动端H5、安卓APP、IOS-APP&#xff09;&#xff0c;以下是教育系统所包含的一些功能&#xff1a; 视频课程&#xff1a;教育系统提供在线视频课程&#xff0c;学生可以通过网络观看教师…

双双入选 中科驭数第二代DPU芯片K2和低时延DPU卡荣获2023年北京市新技术新产品新服务认定

北京市新技术新产品&#xff08;服务&#xff09;认定是北京市从重点发展的先导技术、战略性新兴产业和现代服务业领域中&#xff0c;选拔出技术先进、产权明晰、质量可靠、市场前景广阔&#xff0c;且符合构建“高精尖”经济结构要求的产品及服务&#xff0c;具有较高权威性和…
最新文章