Python 更改代码后继续获取值错误

Python 更改代码后继续获取值错误,python,string,tkinter,Python,String,Tkinter,因此,我一直在尝试运行此程序,但每当我按enter键启动它(该部分工作正常)时,它就会不断抛出此错误: ValueError: dictionary update sequence element #0 has length 1; 2 is required 这条线触发了这一点: words = ["Games","Development","Keyboard","Speed","Typer","Anything","Aplha","Zealous","Accurate","Basics","

因此,我一直在尝试运行此程序,但每当我按enter键启动它(该部分工作正常)时,它就会不断抛出此错误:

ValueError: dictionary update sequence element #0 has length 1; 2 is required
这条线触发了这一点:

words = ["Games","Development","Keyboard","Speed","Typer","Anything","Aplha","Zealous","Accurate","Basics","Shortcut","Purpose","Window","Counter","Fortress","Modification","Computer","Science","History","Football","Basketball","Solid","Phantom","Battlefield","Avdvanced","Warfare","Download","Upload","Antidisestablishmentarianism","Supercalifragilisticexpialidocious","Discomobobulation","Liberated","Assassin","Brotherhood","Revelation","Unity","Syndicate","Victory"]

def nextWord():
        global score
        entry.focus_set()
        if entry.get().lower() == words[1].lower():
            score += 1

        entry.delete(0, tkinter.END)
        random.shuffle(words)
        label.config(str(words[1]), text=str(words[0]))
        scoreLabel.config(text="Score: " + str(score))
我知道它可能在

(str(words[1])
部分原因是我在那个里修改了一些代码,试图修复另一个错误(我做到了)。那么,我有没有遗漏什么? 谢谢

config
只接受一个命名参数,但您给它一个命名参数和一个位置参数。尝试:

label.config(text=str(words[0]))

这里几乎没有足够的代码来告诉您发生了什么错误。完整的代码和回溯错误。另外,您试图用
label.config(str(words[1]),text=str(words[0]))
?这是唯一一行告诉我有错误的代码?仅仅发布有错误的行是不够的。我们需要一个新的答案。谢谢你的帮助,下次我会尽量合理地组织我的问题。
label.config(text=str(words[0]))