绝望中的ParserError

ParserError in kivy

我正在尝试学习 kivy 并在其中创建应用程序。在 .kv 文件中的设计语言中,我发现:

   File "D:\Python divane\pythonProject1\kivy\k#1.py", line 20, in <module>
     Care4Me().run()
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\app.py", line 949, in run
     self._run_prepare()
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\app.py", line 918, in _run_prepare
     self.load_kv(filename=self.kv_file)
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\app.py", line 691, in load_kv
     root = Builder.load_file(rfilename)
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\lang\builder.py", line 306, in load_file
     return self.load_string(data, **kwargs)
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\lang\builder.py", line 373, in load_string
     parser = Parser(content=string, filename=fn)
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\lang\parser.py", line 402, in __init__
     self.parse(content)
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\lang\parser.py", line 511, in parse
     objects, remaining_lines = self.parse_level(0, lines)
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\lang\parser.py", line 614, in parse_level
     _objects, _lines = self.parse_level(
   File "D:\Python divane\pythonProject1\lib\site-packages\kivy\lang\parser.py", line 624, in parse_level
     raise ParserException(self, ln,
 kivy.lang.parser.ParserException: Parser: File "D:\Python divane\pythonProject1\kivy\care4me.kv", line 3:
 ...
       1:<grid>
       2:    Label:
 >>    3:        text = 'OOOOoooo'
 ...
 Invalid property name

这个 ParserError 是由 kivy 抛出的。

The.kv 文件:

<grid>
    Label:
        text = 'OOOOoooo'

我是 kivy 的新手,正在尝试制作我在 tkinter 中制作的应用程序

您必须更改为

text: "OOOOoooo"

(使用:,而不是=)。