网站推广优化排名公司,x cache wordpress,做网站要写多少行代码,局网站建设管理整改情况---------------turtle源码集合---------------
Python教程91#xff1a;关于海龟画图#xff0c;Turtle模块需要学习的知识点
Python教程51#xff1a;海龟画图turtle画#xff08;三角形、正方形、五边形、六边形、圆、同心圆、边切圆#xff0c;五角星#xff0c;椭…---------------turtle源码集合---------------
Python教程91关于海龟画图Turtle模块需要学习的知识点
Python教程51海龟画图turtle画三角形、正方形、五边形、六边形、圆、同心圆、边切圆五角星椭圆
Python源码54海龟画图turtle画天安门
Python源码53海龟画图turtle画圣诞树
Python教程52程序员6款简易版的爱心表白代码合集
Python源码50海龟画图turtle画py图标
Python源码49海龟画图turtle画美国旗
Python教程48海龟画图turtle画太极八卦阵
Python源码47海龟画图turtle画巴斯光年
Python源码46海龟画图turtle画坤坤
Python源码45海龟画图turtle画雪容融
Python源码44海龟画图turtle画2022卡塔尔世界杯吉祥物
Python教程43海龟画图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 math
import turtle as t
# 爱心
def heart():t.pensize(9)t.setheading(90)t.penup()t.color(deeppink)t.goto(-125, -135)t.pendown()t.begin_fill()t.fillcolor(deeppink)t.circle(9, 211)t.fd(9 * 2.4)t.lt(90)t.fd(9 * 2.4)t.circle(9, 211)t.end_fill()
# 头
def head():t.pensize(8)t.pencolor(black)t.penup()t.goto(-130, 170)t.pendown()t.setheading(220)for x in range(580):t.forward(1)if x 250:t.left(0.5)elif x 350:t.left(0.1)else:t.left(0.5)
# 耳朵
def ears():t.setheading(70)for i in range(150):t.forward(1)if i 80:t.left(0.2)elif i 90:t.left(10)else:t.left(0.2)t.setheading(160)for i in range(140):t.forward(1)t.left(0.15)t.setheading(140)for i in range(157):t.forward(1)if i 65:t.left(0.2)elif i 75:t.left(8)else:t.left(0.5)
# 眼睛
def eyes():# 左眼t.pensize(5)t.penup()t.goto(-100, 60)t.setheading(350)t.pendown()t.fillcolor(black)t.begin_fill()step 0.3for i in range(2):for j in range(60):if j 30:step 0.02else:step - 0.02t.forward(step)t.left(3)t.end_fill()# 右眼t.penup()t.goto(50, 40)t.setheading(350)t.pendown()t.fillcolor(black)t.begin_fill()step 0.3for i in range(2):for j in range(60):if j 30:step 0.02else:step - 0.02t.forward(step)t.left(3)t.end_fill()
# 鼻子
def nose():t.penup()t.goto(-40, 30)t.setheading(260)t.pendown()t.fillcolor(#ebc80e)t.begin_fill()step 0.3for i in range(2):for j in range(60):if j 30:step 0.02else:step - 0.02t.forward(step)t.left(3)t.end_fill()
# 小花
def flower(n):for i in range(n):t.forward(0.5)if i 80:t.left(1)elif i 120:t.left(2.3)else:t.left(1)
# 花朵
def flowers():t.penup()t.goto(20, 180)t.pendown()t.fillcolor(#dd4a76)t.begin_fill()t.setheading(175)flower(200)t.setheading(250)flower(200)t.setheading(325)flower(200)t.setheading(40)flower(200)t.setheading(115)flower(170)t.end_fill()t.penup()t.goto(30, 180)t.setheading(270)t.pendown()t.fillcolor(#e7be04)t.begin_fill()t.circle(10)t.end_fill()
# 胡须
def beard():t.penup()t.goto(-150, 65)t.pendown()t.setheading(170)t.pensize(6)for y in range(40):t.forward(1)t.left(0.3)t.penup()t.goto(-150, 85)t.pendown()t.setheading(160)for y in range(50):t.forward(1)t.left(0.3)t.penup()t.goto(-150, 45)t.pendown()t.setheading(180)for y in range(55):t.forward(1)t.left(0.3)t.penup()t.goto(110, 10)t.setheading(340)t.pendown()for y in range(40):t.forward(1)t.right(0.3)t.penup()t.goto(120, 30)t.setheading(350)t.pendown()for y in range(30):t.forward(1)t.right(0.3)t.penup()t.goto(115, 50)t.setheading(360)t.pendown()for y in range(50):t.forward(1)t.right(0.3)
def myarc(t, r, angle):length 2 * math.pi * r * angle / 360 # angle角度的扇形的弧长n int(length / 3) 1 # 线段条数step_length length / n # 每条线段的长度step_angle angle / n # 每条线段的角度polyline(t, n, step_length, step_angle)
def polyline(t, n, length, angle):for index in range(n):t.fd(length)t.lt(angle)
# 身体
def body():t.pensize(8)t.penup()t.goto(-100, -30)t.setheading(230)t.pendown()t.fillcolor(#efa9c1)t.begin_fill()for z in range(140):t.forward(1)t.left(0.2)t.setheading(340)for z in range(200):t.forward(1)t.left(0.1)t.setheading(85)for z in range(140):t.forward(1)t.left(0.1)t.end_fill()t.penup()t.goto(-73, -33)t.pendown()t.setheading(250)t.fillcolor(#da4b76)t.begin_fill()myarc(t, 40, 205)t.setheading(170)t.pensize(6)t.forward(75)t.end_fill()# 左胳膊t.pensize(8)t.penup()t.goto(-120, -17)t.setheading(230)t.pendown()t.fillcolor(#d64b75)t.begin_fill()t.forward(50)t.setheading(320)for k in range(27):t.forward(1)t.left(1)t.setheading(55)for k in range(50):t.forward(1)t.right(0.1)t.end_fill()# 左手t.penup()t.goto(-125, -15)t.setheading(140)t.pendown()t.fillcolor(pink)t.begin_fill()t.forward(8)t.setheading(50)myarc(t, 10, 190)t.setheading(150)for j in range(80):t.forward(1)t.left(2.2)t.forward(24)t.end_fill()# 右胳膊t.penup()t.goto(27, -45)t.pendown()t.fillcolor(#db4e79)t.setheading(350)t.begin_fill()for x in range(50):t.forward(1)t.right(1)t.setheading(220)t.forward(40)t.setheading(100)for x in range(50):t.forward(1)t.left(0.2)t.end_fill()# 右手t.penup()t.goto(70, -75)t.pendown()t.setheading(300)t.forward(8)t.setheading(30)for x in range(40):t.forward(1)t.right(5)t.setheading(280)for x in range(70):t.forward(1)t.right(2)# 右脚t.penup()t.goto(-70, -180)t.pendown()t.setheading(250)for x in range(30):t.forward(1)t.left(0.3)for x in range(160):t.forward(1)if x 30:t.left(3)elif x 65:t.left(0.1)else:t.left(1)# 左脚t.penup()t.goto(-150, -210)t.setheading(340)t.pendown()t.fillcolor(pink)t.begin_fill()step 1.5for i in range(2):for j in range(60):if j 30:step 0.1else:step - 0.1t.forward(step)t.left(3)t.end_fill()
# 主函数
t.setup(0.8, 0.8)
t.title(hellokitty)
t.bgcolor(pink)
t.hideturtle()t.delay(0)
head()
ears()
eyes()
nose()
beard()
flowers()
body()
heart()
t.penup()
t.goto(300, -100)
t.write(我是一只kitty猫, aligncenter, font(楷体, 30, normal))
t.done()完毕感谢您的收看
----------★★历史博文集合★★---------- 我的零基础Python教程Python入门篇 进阶篇 视频教程 Py安装py项目 Python模块 Python爬虫 Json Xpath 正则表达式 Selenium Etree CssGui程序开发 Tkinter Pyqt5 列表元组字典数据可视化 matplotlib 词云图 Pyecharts 海龟画图 Pandas Bug处理 电脑小知识office自动化办公 编程工具