Python 另一个字符串内的字符串中的换行符

Python 另一个字符串内的字符串中的换行符,python,python-3.x,string,kivy,Python,Python 3.x,String,Kivy,我有一个名为kv的字符串 在该字符串中,我有另一个名为text的字符串,text包含一个换行符 我的问题是,kv也断线,我不想这样,我只想用文本字符串断线 kv='' 盒子布局: 方向:“水平” 间距:50 填充:5 按钮: id:btn_aller 文本:“{}-{}\n[size=12](cliquez-pour+d'information)[/size].”格式(root.deep,root.destination) 黑体字:对 ''尝试使用\\n而不是\n: kv=''' BoxLay

我有一个名为
kv
的字符串

在该字符串中,我有另一个名为
text
的字符串,
text
包含一个换行符

我的问题是,
kv
也断线,我不想这样,我只想用
文本
字符串断线

kv=''
盒子布局:
方向:“水平”
间距:50
填充:5
按钮:
id:btn_aller
文本:“{}-{}\n[size=12](cliquez-pour+d'information)[/size].”格式(root.deep,root.destination)
黑体字:对

''
尝试使用
\\n
而不是
\n

kv='''
BoxLayout:
        orientation: 'horizontal'
        spacing: 50
        padding: 5

        Button:
            id: btn_aller
            text: "{} - {} \\n [size=12](cliquez pour plus d'information)[/size]".format(root.depart, root.destination)"
            bold: True
'''
print(kv)
将在控制台上显示以下内容:

BoxLayout:
        orientation: 'horizontal'
        spacing: 50
        padding: 5

        Button:
            id: btn_aller
            text: "{} - {} \n [size=12](cliquez pour plus d'information)[/size]".format(root.depart, root.destination)"
            bold: True