国庆中秋双重喜庆

如本文章标有价格,需议价或其它事情商议请加微信scratch8

"""
   国庆中秋双重喜庆.py
"""
import time
import random
import turtle
from bitmapfont import *
from winsound import *

__author__ = '李兴球'
__date__ = '2020/9/28'

PlaySound('华语群星 - 浏阳河+回娘家+红彩妹妹 (平四版).wav',SND_LOOP|SND_ASYNC)

def steped_write(s):
    """逐字写"""
    for char in s:
        turtle.write(char,move=True,align='center',font=ft)
        turtle.fd(10)
        time.sleep(0.3)
   
alldots = []
def show_charactar(char,scale):
    fontSet = open("./HZK16", "rb")
    for i in getCharacterMatrixMode(fontSet, char):
        for k in i:
            if(int(k)):
                turtle.dot(5*scale)
                alldots.append(turtle.getturtle().items[-1])
                turtle.fd(5*scale)
            else:
                turtle.fd(5*scale)
        turtle.bk(16*5*scale)
        turtle.right(90)
        turtle.fd(5*scale)
        turtle.left(90)
        time.sleep(0.1)

turtle.delay(0)
turtle.speed(0)
turtle.penup()
turtle.setup(480,800)
turtle.bgcolor('black')
turtle.hideturtle()

turtle.color('white')
turtle.goto(-140,330)
show_charactar('祝',1)

turtle.goto(50,330)
show_charactar('您',1)

turtle.color('red')
turtle.goto(-170,190)
show_charactar('国',1.5)

turtle.color('orange')
turtle.goto(30,190)
show_charactar('庆',1.5)

turtle.color('yellow')
turtle.goto(-170,20)
show_charactar('中',1.5)

turtle.color('green')
turtle.goto(30,20)
show_charactar('秋',1.5)

turtle.color('cyan')
turtle.goto(-170,-180)
show_charactar('快',2)

turtle.color('blue')
turtle.goto(30,-180)
show_charactar('乐',2)

turtle.goto(-170,-140)
turtle.color('white')
ft = ('楷体',18,'underline')
steped_write('本程序由Python海龟画图模块制作')
#turtle.write('本程序由Python海龟画图模块制作',align='center',font=ft)

turtle.goto(0,-170)
turtle.color('white')
turtle.write('源码免费下载网址 www.lixingqiu.com',align='center',font=ft)
witem = turtle.getturtle().items[-1]

cs = ['red','orange','yellow','green',
      'cyan','blue','pink','white']

canvas = turtle.getcanvas()

c = 0
index = 0
j = 0
while True:
    dot = alldots[index]    
    canvas.itemconfig(dot,fill=cs[c%len(cs)])
    canvas.update()
    time.sleep(0.01)
    index = index + 1
    index = index % len(alldots)
    if index == 0 : c = c + 1        
    c = c + 1    
    time.sleep(0.1)
    j = j + 1
    if j % 8 == 0 : canvas.itemconfig(witem,fill=random.choice(cs))

本资源于2020年国庆期间是免费下载,现在国庆已过,需要下载请扫码付费:

[hide]

国庆中秋双重喜庆下载:
链接:https://pan.baidu.com/s/1U3Jh2J2H4Ax7w1_smjCNZQ

提取码:kx4a

[/hide]

本站所有作品,教程等皆为原创,版权所有。只供个人及单位内部研究使用,对外展示或传播必需经本站同意,且注明来自本站。培训机构等用本站资源培训学生,需经本站授权。一旦付款,表示同意本站知识付费原则:数字商品,不支持退款。亦可直接向微信号scratch8付款购买。入住QQ群:225792826 和爱好者共同交流,并且能下载免费提供的Python资源(需提供真实姓名才可入群)
李兴球的博客_Python创意编程技术前沿_pygame » 国庆中秋双重喜庆
scratch

学本领,探索更大的世界!

李兴球博客 风火轮编程主页