Python误解了我的列表

Python误解了我的列表,python,tkinter,Python,Tkinter,出于某种原因,Python不断抛出一个TCL错误,其中表示“未知颜色”,尽管它从中获取字符串的列表与颜色无关。这有什么原因吗 #Add words to this list to include them in the game words = ["Games","Development","Keyboard","Speed","Typer","Anything","Aplha","Zealous","Accurate","Basics","Shortcut","Purpose","Window

出于某种原因,Python不断抛出一个TCL错误,其中表示“未知颜色”,尽管它从中获取字符串的列表与颜色无关。这有什么原因吗

#Add words to this list to include them in the game
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(fg=str(words[1]), text=str(words[0]))
        scoreLabel.config(text="Score: " + str(score))
这是新的错误:

ValueError: dictionary update sequence element #0 has length 1; 2 is required
另外,我知道我的一些/大部分代码可能不正确,我想知道如何设置最大的洗牌时间和显示字符串的时间,然后再打印标签中的所有字符串。(第二个问题,如果不想回答,不必回答)
谢谢。

您明确告诉tkinter使用这个词作为颜色;这就是
fg
label.config(fg=str(words[1]),…)
行中所做的


因为它不是一种颜色,所以不应该这样做。

如果出现异常,请发布堆栈跟踪,并确定是哪一行导致了问题。对不起,我是新来的,但我已经更改了它,所以是否可以使用其他方法来修复它或只是删除fg=str?我不明白您试图做什么。是的,如果你不想设置颜色,显然你应该删除它。我试图从列表中获取随机单词并显示在标签中,我已经删除了它,但它会抛出一个值错误,正如khelwood所说,如果你遇到错误,你应该将其与完整的回溯一起发布。