---------------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.8for i in range(120):if 0 <= i < 30 or 60 <= i < 90:n -= 0.05t.left(3)t.fd(n)else:n += 0.05t.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.6for i in range(120):if 0 <= i < 30 or 60 <= i < 90:n -= 0.06t.left(3)t.fd(n)else:n += 0.06t.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.3for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a += lt.lt(3)t.fd(a)else:a -= lt.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():# AdversityAwaket.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()# AdversityAwaket.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()# AdversityAwaket.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():# AdversityAwaket.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():# AdversityAwaket.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")# AdversityAwaket.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()# AdversityAwaket.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自动化办公 编程工具