안녕하세요
기초적인거 하나만 도와주십시오
import kivy
from kivy.lang import Builder
from kivymd.app import MDApp
from kivymd.uix.list import OneLineListItem
from tkinter import messagebox
KV = """
<NoteItem>:
on_release: root.show_msg(self.text)
ScrollView:
MDList:
id: container
"""
class NoteItem(OneLineListItem):
def __init__(self, **kwargs):
super(NoteItem, self).__init__(**kwargs)
def show_msg(self, msg):
messagebox.showinfo("Show Msg",msg )
class Test(MDApp):
def __init__(self, **kwargs):
super(Test, self).__init__(**kwargs)
def build(self):
return Builder.load_string(KV)
def on_start(self):
for i in range(20):
self.root.ids.container.add_widget(
NoteItem(text = f"item list {i}")
)
Test().run()
==> 오류
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/tkinter/__init__.py", line 2576, in __init__
BaseWidget._setup(self, master, cnf)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/tkinter/__init__.py", line 2543, in _setup
master = _get_default_root()
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/tkinter/__init__.py", line 299, in _get_default_root
assert _default_root is root
AssertionError
이렇게 나오는데 뭐가 잘못된것인지 알려주실수 있나요