AttributeError: 'NoneType' object has no attribute '_root'

后端 未结 1 1230
灰色年华
灰色年华 2020-12-11 17:55

I am completely new to Python 3, just following simple exercises from YouTube.

https://www.youtube.com/watch?v=nefopNkZmB4&index=3&list=PL6gx4Cwl9DGAcbMi1sH6

相关标签:
1条回答
  • 2020-12-11 18:21

    Because of the indentation, display = StringVar() is not in a method. That means it is getting executed when the class is first defined. You cannot create an instance of StringVar until after the root window has been created.

    You need to add one more level of indentation for that line, and the line below it.

    0 讨论(0)
提交回复
热议问题