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
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()
<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"
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
Comparação entre os escalonadores BFQ e MQ-Deadline (acesso a disco) no Arch e Debian
Conciliando o uso da ZRAM e SWAP em disco na sua máquina
Servidor de Backup com Ubuntu Server 24.04 LTS, RAID e Duplicati (Dell PowerEdge T420)
Visualizar câmeras IP ONVIF no Linux sem necessidade de instalar aplicativos
Overclocking Permanente para Drastic no Miyoo Mini Plus
Problemas de chaves (/usr/share/keyrings) no Debian
Converter os repositórios Debian para o novo formato com as chaves
Rede wifi com mesmo ip da rede eth (12)
Primeiras impressões do Debian 13 (3)
como resolver o problema de som do linux mint mate (3)