kivy dynamic class

1. kivy dynamic class

noah felix
noah_g4

(usa Ubuntu)

Enviado em 18/08/2020 - 11:14h

Estou criando app em python3-kivy e preciso colocar uma classe dinamica como um layout mas quando eu fasso isso ele me da um erro do qual não consigo identifiar

codigo py:

from kivy.app import App
from kivy.uix.gridlayout import GridLayout

class index(GridLayout):
pass

class scrscr(App):
def build(self):
return index()

scrscr().run()


codigo kv:

<index>:
cols: 3
rows: 1
BoxLayout:
orientation: "vertical"
size_hint_x: None
width: 120
Button:
text: "scr1"
Button:
text: "scr2"
Button:
text: "scr3"
scrone
<scrone@BoxLayout>:
Button:
text: "btn1"
Label:
text: "lbl1"
<scrtow@BoxLayout>:
Button:
text: "btn2"
Label:
text: "lbl2"

erro:

Traceback (most recent call last):
File "scrscr.py", line 11, in <module>
scrscr().run()
File "/home/noah/.local/lib/python3.8/site-packages/kivy/app.py", line 949, in run
self._run_prepare()
File "/home/noah/.local/lib/python3.8/site-packages/kivy/app.py", line 918, in _run_prepare
self.load_kv(filename=self.kv_file)
File "/home/noah/.local/lib/python3.8/site-packages/kivy/app.py", line 691, in load_kv
root = Builder.load_file(rfilename)
File "/home/noah/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 306, in load_file
return self.load_string(data, **kwargs)
File "/home/noah/.local/lib/python3.8/site-packages/kivy/lang/builder.py", line 373, in load_string
parser = Parser(content=string, filename=fn)
File "/home/noah/.local/lib/python3.8/site-packages/kivy/lang/parser.py", line 402, in __init__
self.parse(content)
File "/home/noah/.local/lib/python3.8/site-packages/kivy/lang/parser.py", line 511, in parse
objects, remaining_lines = self.parse_level(0, lines)
File "/home/noah/.local/lib/python3.8/site-packages/kivy/lang/parser.py", line 674, in parse_level
if current_property[:3] == 'on_':
TypeError: 'NoneType' object is not subscriptable




  






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts