无效缩进,必须是8个空格的倍数,圆角按钮kivy .kv文件

Invalid indentation, must be a multiple of 8 spaces, rounded button kivy .kv file

所以是的,我正在学习 kivy - “圆形按钮”,当我 运行 教程的程序时 -------------- 错误: https://i.stack.imgur.com/rGhSa.png python:

from kivy.app import App
from kivy.uix.widget import Widget
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.lang import Builder
from kivy.uix.textinput import TextInput
from kivy.uix.label import Label
from kivy.core.window import Window
Builder.load_file("my.kv")
class MyLayout(Widget,App):
    def __init__(self,*args,**kwargs):
        super(MyLayout, self).__init__(**kwargs)

class AwesomeApp(App):
    def build(self):
        Window.clearcolor = (1,1,1,1)
        return MyLayout()
if __name__ == '__main__':
    AwesomeApp().run()

.kv

<MyLayout>
    BoxLayout:
            orientation: "vertical"
            size: root.width, root.height
            padding: 50
            spacing: 20
            Button:
                text: "Hello World!"
            RoundedButton:
                text: "Goodbye World!"
                pos_hint: {'center_x': 0.5}
                size_hint: (1, .3)
                #background_color: (0/255,255/255,203/255,1)
                #background_normal: ''
<RoundedButton@Button>
    background_color: (0,0,0,0)
    background_normal: ''
    canvas.before:
        Color:
            rgba: (0/255,255/255,203/255,1)
        RoundedRectangle:
            size: self.size
            pos: self.pos
            radius: [58]

谢谢,谁能帮忙,不喜欢这些错误, 缩进错误好像是

您没有进行正确的缩进,您必须在文件中仅使用一种类型的缩进,但您使用了 8 个空格和 4 个空格作为缩进,这就是出现错误的原因。

在这里,我在整个代码中使用了 4 个空格作为缩进,这就是它工作正常的原因。

<MyLayout>
    BoxLayout:
        orientation: "vertical"
        size: root.width, root.height
        padding: 50
        spacing: 20
        Button:
            text: "Hello World!"
        RoundedButton:
            text: "Goodbye World!"
            pos_hint: {'center_x': 0.5}
            size_hint: (1, .3)
                #background_color: (0/255,255/255,203/255,1)
                #background_normal: ''
<RoundedButton@Button>
    background_color: (0,0,0,0)
    background_normal: ''
    canvas.before:
        Color:
            rgba: (0/255,255/255,203/255,1)
        RoundedRectangle:
            size: self.size
            pos: self.pos
            radius: [58]