我正在尝试使用 tkinter 和 python 制作一个音乐应用程序,但我无法摆脱“ValueError:没有足够的值来解压(预期 2,得到 1)”错误。看看我的代码,你就会很清楚我在处理什么。
机制很简单,我首先通过字典(列表)显示歌曲选项,并在输入后显示“j”的对应值,(例如,如果输入为1,则j为1,j的对应值i) 保存为歌曲名并通过播放音乐来执行程序。
list = {
'1':'Say You Won t Let Go.mp3','2':'In the Jungle the mighty jungle.mp3'
}
lost = ''
print(list)
print("which one?")
this_one = int(input(''))
for j,i in list:
if j == this_one:
lost = i
Run Code Online (Sandbox Code Playgroud)