无效的属性名称

时间:2019-05-26 04:20:57

标签: python kivy

Traceback (most recent call last):
   File "C:/Users/Mahendra choudhary/PycharmProjects/untitled/venv/main.py", line 16, in <module>
     calcApp.run()
   File "C:\Users\Mahendra choudhary\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\app.py", line 799, in run
     self.load_kv(filename=self.kv_file)
   File "C:\Users\Mahendra choudhary\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\app.py", line 596, in load_kv
     root = Builder.load_file(rfilename)
   File "C:\Users\Mahendra choudhary\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\lang\builder.py", line 301, in load_file
     return self.load_string(data, **kwargs)
   File "C:\Users\Mahendra choudhary\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\lang\builder.py", line 368, in load_string
     parser = Parser(content=string, filename=fn)
   File "C:\Users\Mahendra choudhary\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\lang\parser.py", line 392, in __init__
     self.parse(content)
   File "C:\Users\Mahendra choudhary\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\lang\parser.py", line 501, in parse
     objects, remaining_lines = self.parse_level(0, lines)
   File "C:\Users\Mahendra choudhary\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\lang\parser.py", line 614, in parse_level
     raise ParserException(self, ln,'Invalid property name')
 kivy.lang.parser.ParserException: Parser: File "C:\Users\Mahendra choudhary\PycharmProjects\untitled\venv\calculator.kv", line 2:
 ...
       1:<CustButton@Button>:
 >>    2:  font_size = 32
       3:
       4:<CalcGridLayout>:
 ...
 Invalid property name
import kivy
kivy.require("1.9.0")

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

class CalcGridLayout(GridLayout):
      pass

class CalculatorApp(App):

    def build(self):
        return CalcGridLayout()

calcApp = CalculatorApp()
calcApp.run()

0 个答案:

没有答案