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

python——turtle的应用

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

python——turtle的应用

根据俺的无脑想法,一顿无脑操作。弄出来个啥东西!!!

给大家欣赏欣赏!!!

from turtle import *
import time
a = [-400,-280]
b = [-368,-248]
c = [60,120]
setup(1000,800)
screensize(1000,800,'pink')
pencolor('black')
pensize(3)
speed(10)

#乌龟向某坐标点无痕迹移动
def yudon(x,y):
    up()
    goto(x,y)
    pd()

#小红花
def xiaohonhua():
    speed(10)
    begin_fill()
    right(90)
    fillcolor('green')
    fd(10)
    circle(10,180)
    end_fill()
    begin_fill()
    fillcolor('green')
    for i in range(9):
        fd(10)
        right(140)
        fd(10)
        circle(10,180)
    fd(10)
    end_fill()
    begin_fill()
    fillcolor('red')
    left(290)
    circle(30,360)
    end_fill()
    right(70)
    begin_fill()


for i in range(2):
    yudon(a[i],0)
    left(c[i])
    fd(100)
    right(120)
    fd(100)
    yudon(b[i],0)
    begin_fill()
    fillcolor('red')
    circle(20,360)
    end_fill()
yudon(-330,-40)
right(30)
circle(40,180)
yudon(-420,0)
left(180)
circle(130,360)
yudon(-50,100)
#第一个小红花
xiaohonhua()
yudon(80,100)
#第二个小红花
xiaohonhua()
yudon(220,110)
#第三个小红花
xiaohonhua()
yudon(-20,65)
xx = '恭'
write(xx, font=('Arial', 30, 'bold'), align="center")
yudon(92,50)
xx = '喜'
write(xx, font=('Arial', 30, 'bold'), align="center")
yudon(205,63)
xx = '你'
write(xx, font=('Arial', 30, 'bold'), align="center")
yudon(-350,-5)
xx = '羡'
write(xx, font=('Arial', 15, 'bold'), align="center")
yudon(-230,-5)
xx = '慕'
write(xx, font=('Arial', 15, 'bold'), align="center")
yudon(0,200)
pencolor('red')
xx = '专属表彰'
write(xx, font=('Arial', 50, 'bold'), align="center")
pencolor('black')
yudon(150,-200)
xx = '我们是世界的尘埃n却也是自己的英雄nn            -----给正在努力的那个你'
write(xx, font=('Arial', 20, 'bold'), align="center")
hideturtle()
done()

 

运行效果

 

 

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

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

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