栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

python海龟画图(7)微信logo

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

python海龟画图(7)微信logo


 

import turtle as t
t.speed(0)
t.bgcolor("dimgray")
def sibianxing():
    t.pu()
    t.goto(-90,-120)
    t.pencolor("black")
    t.fillcolor("white")
    t.pensize(2)
    t.begin_fill()
    t.pd()
    for j in range(4):
        t.fd(250)
        t.circle(80,90)
    t.end_fill()
def tuoyuan1(x,y,n,c):
    t.pu()
    t.goto(x,y)
    t.pd()
    lenth = 5
    t.pencolor(c)
    t.begin_fill()
    t.fillcolor(c)
    for angle in range(0,360,2):
        t.seth(angle)
        t.fd(lenth)
        if 0<=angle<90 or 180<=angle<270:
            lenth = lenth - 0.05
        elif angle==n:
            t.rt(50)
            for i in range(3):
                t.fd(40)
                t.lt(120)                 
            t.lt(50)
            continue
        else:
            lenth = lenth + 0.05
    t.end_fill()
def tuoyuan2(x,y,n,c):
    t.pu()
    t.goto(x,y)
    t.pd()
    lenth = 4
    t.pencolor(c)
    t.begin_fill()
    t.fillcolor(c)
    for angle in range(0,360,2):
        t.seth(angle)
        t.fd(lenth)
        if 90<=angle<180 or 270<=angle<360:
            lenth = lenth + 0.04
        elif angle==n:
            t.rt(45)
            for i in range(3):
                t.fd(30)
                t.lt(120)                 
            t.lt(45)
            continue
        else:
            lenth = lenth - 0.04
    t.end_fill()
def yanjing1(r,x,y):
    t.pu()
    t.goto(x+50,y+120)
    t.pd
    t.begin_fill()
    t.pencolor("darkgreen")
    t.fillcolor("darkgreen")
    t.circle(r)
    t.end_fill()
def yanjing2(r,x,y):
    t.pu()
    t.goto(x+50,y+100)
    t.pd
    t.begin_fill()
    t.pencolor("dimgray")
    t.fillcolor("dimgray")
    t.circle(r)
    t.end_fill()
sibianxing()
tuoyuan1(0,0,316,"green")
yanjing1(8,0,0)
yanjing1(8,-100,0)
tuoyuan2(100,-50,20,"silver")
yanjing2(6,100,-50)
yanjing2(6,10,-50)
t.ht()
t.exitonclick()

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/350124.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号