用python写一个赛博菩萨

import tkinter
import tkinter as tk
from functools import partial
from tkinter import *
from tkinter import messagebox
from PIL import ImageTk
import pygame
i=0
def gongde():
global i
pygame.mixer.init()
pygame.mixer.music.load(r’电子木鱼音乐的路径’)
pygame.mixer.music.play()
i=i+1
# m.insert(tkinter.END,i)
m.delete(‘1.0’, ‘end’)
m.insert(tkinter.END, i)

def fozu():
pygame.mixer.init()
pygame.mixer.music.load(r’佛祖笑的路径’)
pygame.mixer.music.play()
root = tk.Tk()
root.title(‘电子木鱼’)
root.geometry(‘500x800’)
photo = ImageTk.PhotoImage(file=r’图片’)
label = tk.Label(root, image=photo,height=500,width=500)
label.grid()
photo1 = ImageTk.PhotoImage(file=r’图片’)
shu=LabelFrame(root,text=‘你的功德’,font=(“宋体”,25),fg=“red”)
shu.grid()
m=Text(shu,height=2,width=10)
m.grid()
label1 = Button(root,image=photo1,font=(“宋体”,25),fg=“red”,height=100,width=200,command=partial(gongde))
label1.grid()
button = Button(root,text=“扣1佛祖陪你一起笑”,font=(“宋体”,25),fg=“blue”,command=fozu)
button.grid()
root.mainloop()

猜你喜欢

转载自blog.csdn.net/qq_33655643/article/details/129500972