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

这篇具有很好参考价值的文章主要介绍了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画彩色六边形
Python教程44:海龟画图turtle画卡塔尔世界杯吉祥物,我的Python教程,# 海龟画图,python,Python教程,海龟画图

# @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自动化办公 编程工具
Python教程44:海龟画图turtle画卡塔尔世界杯吉祥物,我的Python教程,# 海龟画图,python,Python教程,海龟画图文章来源地址https://www.toymoban.com/news/detail-798732.html

到了这里,关于Python教程44:海龟画图turtle画卡塔尔世界杯吉祥物的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Python海龟turtle基础知识大全与画图集合

    Turtle图形库 Turtle 库是 Python 内置的图形化模块,属于标准库之一,位于 Python 安装目录的 lib 文件夹下,常用函数有以下几种: 画布是turtle用于绘图区域,我们可以设置它的大小和初始位置。 1.设置画布大小 turtle.screensize(canvwidth=None, canvheight=None, bg=None) ,参数分别对应画布的

    2024年01月25日
    浏览(31)
  • 用Python创建海龟图形(turtle 库用法)

    徽标编程是一种基本的编程语言,可以使用基本命令创建形状和数字。它被介绍给孩子们,让他们对编程有一个基本的了解。 在Python中,我们可以使用turtle 库来处理模拟Logo编程语言的海龟图形。这个预装的库可以让我们用像Logo编程一样的简单命令来创建和处理海龟图形。

    2024年02月12日
    浏览(24)
  • python使用海龟turtle实现绘制汉字、中文

            使用python中的turtle库绘制指定汉字、中文         1、要想实现汉字的绘制,首先需要知道汉字的笔画坐标,汉字的笔画坐标在网上有,需要使用爬虫技术抓取到指定汉字的笔画坐标信息   2、根据汉字的笔画坐标信息,使用turrle绘制出相应的笔画,即可实现汉字的绘

    2024年02月10日
    浏览(21)
  • python-turtle(海龟绘图)圣诞树

    1.在开始前需要引入turtle库,若没有下载这个库可以复制下面这条语句在PyCharm终端下载   2.turtle库,它这个画笔是在这个窗口横轴x轴,纵轴y轴从原点(0,0)处开始,以函数指令使其移动绘图。  最近今天持续发烧,没来得急上传,赶一波末班车嘻嘻

    2024年02月03日
    浏览(24)
  • Python中利用海龟绘图(Turtle方法)画个钟表盘

    目录 前言         一、海龟绘图(Turtle)是什么?         二、Turtle 方法         三、主要代码和效果图         1.引入库                   2.主要代码                   3.全部代码                         ​​​效果图 总结 海

    2023年04月08日
    浏览(16)
  • Python---练习:小海龟会画画---利用turtle(海龟)模块

    在Python 3 版本中,新增加了一个 模块叫做turtle(海龟) , 专门用于绘制图形图像 turtle    英 /ˈtɜːt(ə)l/     n. 海龟;海龟肉;美龟;淡水龟; (计算机)龟标  import 英 /ˈɪmpɔːt/  n. 进口,进口商品;输入, 引进 ;重要性;意思,含意 v. 进口,输入,引进; 导入(

    2024年02月08日
    浏览(25)
  • Python的海龟 turtle 库使用详细介绍(画任意多边形,全网最详细)

    学Turtle库,其实就是学数学,而且还能提高对数学和学习的兴趣。Turtle库还能够帮助孩子更好地理解几何学和数学概念,比如角度、比例、几何图形的性质等等,是Python中一个很有趣的库。 Turtle库是Python中一个很有趣的库,可以用来绘制各种图形,比如直线、圆、正方形等等

    2024年04月13日
    浏览(16)
  • 用Python海龟画图画哆啦A梦

      前言 一、画哆啦A梦脸的外圈蓝色 二、画哆啦A梦脸的内圈白色 三、哆啦A梦的鼻子 四、哆啦A梦的鼻尖 五、哆啦A梦的左眼 六、哆啦A梦的右眼 七、哆啦A梦的左眼内部 八、哆啦A梦的右眼内部 九、 哆啦A梦的右眼内部白色圆点 十、 哆啦A梦的鼻子下面的黑色竖线 十一、 哆

    2024年02月04日
    浏览(18)
  • 手机python怎么用海龟画图,python怎么在手机上编程

    大家好,给大家分享一下手机python怎么用海龟画图,很多人还不知道这一点。下面详细解释一下。现在让我们来看看! 如果您想在手机上使用Python来创建AI(人工智能)程序,您可以考虑以下几种方式: 需要注意的是,虽然在手机上编写和运行Python程序可能不如在PC或者服务

    2024年02月15日
    浏览(26)
  • Python的画图模块turtle使用详解

    简介:Turtle是Python语言中一个很流行的简单的绘图工具。你可以把它理解为一个小海龟,只听得懂有限的指令。它在一个横轴为x、纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行的路径上绘制了图形。 turtle绘图的

    2024年01月19日
    浏览(21)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包