AttributeError: 'NoneType' object has no attribute

0

Hello, I'm doing some testing with the Kivy framework and this error is being presented to me:

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

Well, follow the Python code:

class Window(BoxLayout):

    text = StringProperty('Nome')
    screen_manager = ScreenManager()

    def __init__(self, **kwargs):

        super(Window, self).__init__(**kwargs)


class Main(App):

    def build(self):

        return Window()


if __name__ == '__main__':

    Main().run()

And the code in KV language :

<Window>:
    Screen:
        BoxLayout:
            Button:
                text: app.root.text
    
asked by anonymous 16.04.2018 / 21:43

0 answers