Skip to content Skip to sidebar Skip to footer

Attributeerror: 'super' Object Has No Attribute '__getattr__'

I've been searching for the solution of this problem over the all internet but I still can't find the right solution. There are lots of generic answers but none of those have solve

Solution 1:

The structure of your .kv does not look correct, for example it is observed that there are many roots that would cause you another problem, so if you want a response that tells you the reason for your problem you should improve your indentation.

Instead I'll show you a correct .kv where the root will be the BoxLayout and your child the Label with id time:

clock.kv

<Label>:font_name:'Roboto'font_size:60markup:TrueBoxLayout:orientation:'vertical'Label:id:timetext:'[b]00[/b]:00:00'

main.py

from kivy.app import App
from kivy.clock import Clock
from kivy.core.text import LabelBase
from kivy.core.window import Window
from kivy.utils import get_color_from_hex
from time import strftime


classClockApp(App):
    defon_start(self):
        Clock.schedule_interval(self.update, 0)

    defupdate(self, *args):
        self.root.ids.time.text = strftime('[b]%H[/b]:%M:%S')

if __name__ == '__main__':
    Window.clearcolor = get_color_from_hex('#101216')
    LabelBase.register(name='Roboto', fn_regular='Roboto-Thin.ttf', fn_bold='Roboto-Medium.ttf')
    ClockApp().run() 

enter image description here

Post a Comment for "Attributeerror: 'super' Object Has No Attribute '__getattr__'"