Indent error

2

I'm trying to create a TextInput in Kivy and set its dimensions, except that whenever it puts its error dimensions:

  

invalid indentation, must be a multiple of 4 spaces.

I still do not understand why you are giving this error.

FloatLayout:

TextInput:
    size_hint:1., .5
    pos_hint{'x':.35,'y':.56}


Button:
    size_hint:.3,.1
    pos_hint:{'x':.35,'y':.1}
    text:'1'
Button:
    size_hint:.3,.1
    pos_hint:{'x':.35,'y':.5}
    text:'2'       
    
asked by anonymous 20.12.2018 / 19:06

1 answer

1

Probably because you are mixing spaces with tabs, they are different characters. The error is quite clear, you used 4 spaces for indentation and should be like this in all code. Even I can almost guarantee that the first one is with the wrong indentation, it must be a level above, but it may be that it was only wrong to post here. So I always say:

Moral of the story: you need to learn everything from the language, you need to understand the darkest details, you need to learn in a structured way.

    
20.12.2018 / 19:21