0

I am reading through some source code for KivyMD and I came across \ in a kV file. Can't find what this means. Probably a silly question but could anyone tell me... Thanks

<ButtonContentsText>
    lbl_txt: lbl_txt
    width:
        max( \
        root._min_width, \
        root.padding[0] + lbl_txt.texture_size[0] + root.padding[2] \
        )
Eoin Brennan
  • 131
  • 7

1 Answers1

2

Python code is being embedded in Kivy language. You can see this by the use of max and operators. In Python, you can continue a line with a backslash. Thus

<ButtonContentsText>
    lbl_txt: lbl_txt
    width:
        max( \
        root._min_width, \
        root.padding[0] + lbl_txt.texture_size[0] + root.padding[2] \
        )

is equivalent to

<ButtonContentsText>
    lbl_txt: lbl_txt
    width:
        max(root._min_width, root.padding[0] + lbl_txt.texture_size[0] + root.padding[2])
pigrammer
  • 2,603
  • 1
  • 11
  • 24