这个 ‘\’符号的作用是连接变量或者代码过长,仔细看下面代码,理解它的用法:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import MySQLdb

a = "https://blog.51cto.com"\
    "dinghanhua/p/"\
    "9900775.html"
print a

b= """第一行
第二行
第三行"""

print b

c = "thins line is toooooooooooo\
lone"
print "c: ",c

d = "https://blog.51cto.com/\
dinghanhua/p/\
9900775.html"
print "d: ",d

print "thins line is toooooooooooo\
lone"

上面的输出结果

https://blog.51cto.com/dinghanhua/p/9900775.html
第一行
第二行
第三行
c:  thins line is toooooooooooolone
d:  https://blog.51cto.com/dinghanhua/p/9900775.html
thins line is toooooooooooolone