I'm trying to schedule a calendar using python and the kivy module, but I'm having a problem that I do not understand how I can solve:
This is the calendar.py file:
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import ScreenManager, Screen
import calendar
from datetime import datetime
now = datetime.now()
cal = calendar.Calendar()
class Gerenciador(ScreenManager):
pass
class Tarefas(Screen):
def __init__(self,**kwargs):
super().__init__(**kwargs)
for dia in cal.itermonthdays(now.year, now.month):
self.ids.box.add_widget(Tarefa(text=str(dia)))
class Tarefa(BoxLayout):
def __init__(self,text='',**kwargs):
super().__init__(**kwargs)
self.ids.label.text = text
class Window(App):
def build(self):
return Gerenciador()
Window().run()
This is Window.kv:
<Gerenciador>:
Tarefas:
<Tarefas>:
BoxLayout:
orientation:'vertical'
ScrollView:
BoxLayout:
id:box
orientation:'vertical'
size_hint_y:None
height:self.minimum_height
<Tarefa>:
size_hint_y:None
height:200
Label:
id:label
font_size:30
When running it results in the error 'super' object has no attribute ' getattr ' pointing to the line self.ids.box.add_widget (Task (text = str (day) br> Please help me !!