TypeError: 'NoneType' object does not support item assignment?

前端 未结 2 535
盖世英雄少女心
盖世英雄少女心 2021-01-14 03:18

So I start a root screen with a \"file select\" and a \"go\" button. The go button is disabled and I want to make it active after the file has been selected. When I select

2条回答
  •  花落未央
    2021-01-14 03:57

    (update for new error) go doesn't exist in that scope, you'll need to get access to it somehow, or by using the one in the global scope using global go inside the chooseDir method perhaps

    Tkinter.Buttons don't behave like dictionaries, you can change their status via the config() method.

    Try:

    go.config(state=Tkinter.ACTIVE)
    

提交回复
热议问题