Python 敲电子木鱼,见机甲佛祖,修赛博真经

Python 敲电子木鱼,见机甲佛祖,修赛博真经

相关资源文件已经打包成EXE文件,可下载相关资源压缩包后双击直接运行程序,且文章末尾已附上相关源码,以供大家学习交流,博主主页还有更多Python相关程序案例,秉着开源精神的想法,望大家喜欢,点个关注不迷路!!!

1. 简介:

用Python 敲电子木鱼,使用自动功德机,见机甲佛祖,修赛博真经。无需登录即可每日敲木鱼,每敲一下功德+1,心中的焦虑似乎也减少了呢。

功能:

1、禅意随行,一键敲心!电子木鱼,随时随地,修行不断。

2、通过鼠标点击木鱼图片来积攒功德。

  1. 加敲击音效和敲击动作。

2. 运行效果:

3. 相关源码:

python 复制代码
import time
import tkinter
import threading
import pygame # pip install pygame
from PIL import Image, ImageTk # pip install pillow

# 准备音频
pygame.mixer.init()
pygame.mixer.music.load('敲.mp3')

# 界面
top=tkinter.Tk()
top.title('敲电子木鱼,攒无量功德')
top.geometry('410x400')
top.configure(bg='black')
top.iconbitmap('muyu.ico')

# 准备图片
qiaomuyutupian=ImageTk.PhotoImage(file='敲木鱼.jpg') # 转化为tkinter可以使用的图片
qiaomuyutupian2=ImageTk.PhotoImage(file='敲木鱼2.jpg') # 转化为tkinter可以使用的图片

# 初始化功德
gongde=0

# 标签
label1=tkinter.Label(top,text='积攒功德:'+str(gongde),font=('华文新魏',15),fg='white',bg='black',width=18)
label1.place(x=100,y=70)

def showplus():
	for i in range(4):
		text1.insert('insert',' \n')
	else:
		text1.insert('insert',' 功德 + 1')

	for i in range(5):
		time.sleep(0.03)
		text1.delete(1.0, 2.0)

def changetupian():
	button1.config(image=qiaomuyutupian2)
	time.sleep(0.1)
	button1.config(image=qiaomuyutupian)

# 方法
def qiaomuyu():
	# 设gongde为全局变量,并更新标签
	global gongde
	gongde=gongde+1
	label1.config(text='积攒功德:'+str(gongde))

	# 多线程启动解决延时,虽然延迟足够小,但为了更有效果
	th=threading.Thread(target=pygame.mixer.music.play)
	th.start()

	th2=threading.Thread(target=showplus)
	th2.start()

	th3=threading.Thread(target=changetupian)
	th3.start()

# 按钮
button1=tkinter.Button(top,image=qiaomuyutupian,relief='ridge',command=qiaomuyu)
button1.place(x=100,y=100)

text1=tkinter.Text(top,width=10,height=5,bg='black',bd=0,foreground='white')
text1.place(x=125,y=115)


top.mainloop()
相关推荐
2301_793086871 小时前
JVM 01 运行区域
java·开发语言
愤怒的小鸟~~~1 小时前
c语言创建的一个队列结构(含有这个头指针和这个尾指针的结构具有一定的参考价值)
c语言·开发语言·算法
叫我:松哥2 小时前
python案例:基于python 神经网络cnn和LDA主题分析的旅游景点满意度分析
人工智能·python·神经网络·数据挖掘·数据分析·cnn·课程设计
2202_756749693 小时前
01 基于sklearn的机械学习-机械学习的分类、sklearn的安装、sklearn数据集及数据集的划分、特征工程(特征提取与无量纲化、特征降维)
人工智能·python·机器学习·分类·sklearn
鹿野素材屋3 小时前
C#中对于List的多种排序方式
开发语言·c#
whxnchy4 小时前
C++刷题 - 7.27
开发语言·c++
王者鳜錸4 小时前
PYTHON从入门到实践-18Django从零开始构建Web应用
前端·python·sqlite
冗量4 小时前
PPT自动化 python-pptx - 8: 文本(text)
python·自动化·powerpoint
白日梦想家-K4 小时前
题单【模拟与高精度】
开发语言·c++·算法
超级晒盐人4 小时前
用落霞归雁的思维框架推导少林寺用什么数据库?
java·python·系统架构·学习方法·教育电商