卡死,无法运行
本帖最后由 weiter 于 2020-11-22 10:37 编辑在运行的时候卡了bug……
系统报错:
问题签名:
问题事件名称: APPCRASH
应用程序名: pythonw.exe
应用程序版本: 3.8.5150.1013
应用程序时间戳: 5f15bc06
故障模块名称: tcl86t.dll
故障模块版本: 8.6.2.9
故障模块时间戳: 5c12d505
异常代码: 4000001f
异常偏移: 000c13c2
OS 版本: 6.1.7601.2.1.0.256.1
区域设置 ID: 2052
其他信息 1: ea5d
其他信息 2: ea5de30aedec8fc13d9fca227e4f890c
其他信息 3: ddf4
其他信息 4: ddf445572254708782ec82d52e6d3537
联机阅读隐私声明:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0804
如果无法获取联机隐私声明,请脱机阅读我们的隐私声明:
C:\Windows\system32\zh-CN\erofflps.txt
from tkinter import *
from tkinter.font import *
from tkinter import messagebox
from tkinter import filedialog
from pygame import * # https://fishc.com.cn/forum.php?mod=viewthread&tid=177465&highlight=mp3
root = Tk()
root.title('MP3 player')
root.resizable(0,0)
mixer.init() # 初始化播放器
def about():
tk0 = Tk()
tk0.attributes('-alpha', 0.9)
tk0.title('关于 MP3 player')
tk0.resizable(0,0)
tk0.mainloop()
def docs():
tk1 = Tk()
tk1.attributes('-alpha', 0.9)
tk1.title('帮助文档')
tk1.resizable(0,0)
l0b = Label(tk1, text='帮助文档', font=ft0)
l0b.grid(row=0, column=0, padx='5px', pady='2px')
tk1.mainloop()
# waiting to be write
def openfile():
global fn
fn = filedialog.askopenfilename()
fnf = fn.split('/')
fnff = fnf[-1]
l1.config(text=fnff[:fnff.rfind('.')], fg='black')
mixer.music.load(fn)
mixer.music.play()
mixer.music.pause()
b2.config(text=' ▷ ', fg='green', command=startplay)
mixer.music.set_volume(s1.get()*0.01)
def startplay():
mixer.music.unpause()
b2.config(text=' ‖ ', fg='blue', command=rest)
def rest():
mixer.music.pause()
b2.config(text=' ▷ ', fg='green', command=startplay)
def stopplay():
mixer.music.stop()
l1.config(text='还没有打开文件哟~', fg='gray')
def volumeconsole(self):
mixer.music.set_volume(s1.get()*0.01)
l5.config(text=str(s1.get()) + '%')
def playloops(self):
pass
def fpass():
pass
def bpass():
pass
ft0 = Font(family='微软雅黑', size=12)
ft1 = Font(size=15)
m0 = Menu(root)
m1 = Menu(m0, tearoff=False)
m1.add_command(label='关于 MP3 player', command=about)
m1.add_separator()
m1.add_command(label='帮助文档', command=docs)
m0.add_cascade(label='更多', menu=m1)
root.config(menu=m0)
l0 = Label(root, text='正在播放 :', fg='orange',font=ft0)
l0.grid(row=0, column=0, padx='5px', pady='2px')
l1 = Label(root, font=ft0)
l1.config(text='还没有打开文件哟~', fg='gray')
l1.grid(row=0, column=1, columnspan=2, padx='5px', pady='2px')
# l2 = Label(root, font=ft0)
# l2.config(text='00:00')
# l2.grid(row=1, column=0, padx='5px', pady='2px')
# s0 = Scale(root, from_=0, to=100, orient=HORIZONTAL, length=250, showvalue=0, command=playloops)
# s0.grid(row=1, column=1, columnspan=3)
# l3 = Label(root, font=ft0)
# l3.config(text='00:00')
# l3.grid(row=1, column=4, padx='5px', pady='2px')
b0 = Button(root, text=' ✉ ', command=openfile, fg='purple', font=ft0)
b0.grid(row=1, column=2, padx='5px', pady='2px')
# b1 = Button(root, text='◁◁', command=fpass, fg='grey', font=ft0)
# b1.grid(row=2, column=0, padx='5px', pady='2px')
b2 = Button(root, font=ft0)
b2.grid(row=1, column=0, padx='5px', pady='2px')
b2.config(text=' ▷ ', fg='green', command=startplay)
# b3 = Button(root, text='▷▷', command=bpass, fg='gray', font=ft0)
# b3.grid(row=2, column=2, padx='5px', pady='2px')
b4 = Button(root, text='□', fg='red', command=stopplay, font=ft1)
b4.grid(row=1, column=1, padx='5px', pady='2px')
l4 = Label(root, fg='gray', font=ft0)
l4.config(text=' ♫ ')
l4.grid(row=3, column=0, padx='5px', pady='2px')
s1 = Scale(root, from_=0, to=100, orient=HORIZONTAL, length=200, showvalue=0, command=volumeconsole)
s1.grid(row=3, column=1)
l5 = Label(root, fg='#cc99ff', font=ft0)
l5.config(text=str(s1.get()) + '%')
l5.grid(row=3, column=2)
root.mainloop()
Pygame 无法分配内存(第一张照片的第三行)
可能的解决办法:以管理员身份运行,重装
(反正我从来没遇到过,淦)
_2_ 发表于 2020-11-22 10:49
Pygame 无法分配内存(第一张照片的第三行)
可能的解决办法:以管理员身份运行,重装
(反正我从来没遇到过 ...
但是我在这个代码修改前的就可以正常运行……
淦
weiter 发表于 2020-11-22 10:57
但是我在这个代码修改前的就可以正常运行……
淦
?你改了哪里 _2_ 发表于 2020-11-22 10:57
?你改了哪里
源代码如下:
from tkinter import *
from tkinter.font import *
from tkinter import messagebox
from tkinter import filedialog
from pygame import * # https://fishc.com.cn/forum.php?mod=viewthread&tid=177465&highlight=mp3
root = Tk()
root.title('MP3 player')
root.resizable(0,0)
mixer.init() # 初始化播放器
def about():
tk0 = Tk()
tk0.attributes('-alpha', 0.9)
tk0.title('关于 MP3 player')
tk0.resizable(0,0)
tk0.mainloop()
def docs():
tk1 = Tk()
tk1.attributes('-alpha', 0.9)
tk1.title('帮助文档')
tk1.resizable(0,0)
l0b = Label(tk1, text='帮助文档', font=ft0)
l0b.grid(row=0, column=0, padx='5px', pady='2px')
tk1.mainloop()
# waiting to be write
def openfile():
global fn
fn = filedialog.askopenfilename()
fnf = fn.split('/')
fnff = fnf[-1]
l1.config(text=fnff[:fnff.rfind('.')], fg='black')
mixer.music.load(fn)
mixer.music.play()
mixer.music.pause()
b2.config(text=' ▷ ', fg='green', command=startplay)
mixer.music.set_volume(s1.get()*0.01)
def startplay():
mixer.music.unpause()
b2.config(text=' ‖ ', fg='blue', command=rest)
def rest():
mixer.music.pause()
b2.config(text=' ▷ ', fg='green', command=startplay)
def stopplay():
mixer.music.stop()
l1.config(text='还没有打开文件哟~', fg='gray')
def volumeconsole(self):
mixer.music.set_volume(s1.get()*0.01)
l5.config(text=str(s1.get()) + '%')
def playloops(self):
pass
def fpass():
pass
def bpass():
pass
ft0 = Font(family='微软雅黑', size=12)
ft1 = Font(size=15)
m0 = Menu(root)
m1 = Menu(m0, tearoff=False)
m1.add_command(label='关于 MP3 player', command=about)
m1.add_separator()
m1.add_command(label='帮助文档', command=docs)
m0.add_cascade(label='更多', menu=m1)
root.config(menu=m0)
l0 = Label(root, text='正在播放 :', fg='orange',font=ft0)
l0.grid(row=0, column=0, padx='5px', pady='2px')
l1 = Label(root, font=ft0)
l1.config(text='还没有打开文件哟~', fg='gray')
l1.grid(row=0, column=1, columnspan=2, padx='5px', pady='2px')
# l2 = Label(root, font=ft0)
# l2.config(text='00:00')
# l2.grid(row=1, column=0, padx='5px', pady='2px')
# s0 = Scale(root, from_=0, to=100, orient=HORIZONTAL, length=250, showvalue=0, command=playloops)
# s0.grid(row=1, column=1, columnspan=3)
# l3 = Label(root, font=ft0)
# l3.config(text='00:00')
# l3.grid(row=1, column=4, padx='5px', pady='2px')
b0 = Button(root, text=' ✉ ', command=openfile, fg='purple', font=ft0)
b0.grid(row=1, column=2, padx='5px', pady='2px')
# b1 = Button(root, text='◁◁', command=fpass, fg='grey', font=ft0)
# b1.grid(row=2, column=0, padx='5px', pady='2px')
b2 = Button(root, font=ft0)
b2.grid(row=1, column=0, padx='5px', pady='2px')
b2.config(text=' ▷ ', fg='green', command=startplay)
# b3 = Button(root, text='▷▷', command=bpass, fg='gray', font=ft0)
# b3.grid(row=2, column=2, padx='5px', pady='2px')
b4 = Button(root, text='□', fg='red', command=stopplay, font=ft1)
b4.grid(row=1, column=1, padx='5px', pady='2px')
l4 = Label(root, fg='gray', font=ft0)
l4.config(text=' ♫ ')
l4.grid(row=3, column=0, padx='5px', pady='2px')
s1 = Scale(root, from_=0, to=100, orient=HORIZONTAL, length=200, showvalue=0, command=volumeconsole)
s1.grid(row=3, column=1)
l5 = Label(root, fg='#cc99ff', font=ft0)
l5.config(text=str(s1.get()) + '%')
l5.grid(row=3, column=2)
root.mainloop()
_2_ 发表于 2020-11-22 10:49
Pygame 无法分配内存(第一张照片的第三行)
可能的解决办法:以管理员身份运行,重装
(反正我从来没遇到过 ...
解决了,虽然不是按照你的方法{:10_250:} weiter 发表于 2020-11-22 17:47
解决了,虽然不是按照你的方法
谢谢
页:
[1]