x = "test"
print "this is %r" %x 输出 this is 'test'
说明 %r 在输出字符串时,会把单引号也输出来
%r 将原对象原封不动的输出
比如 test = ' i %r am'
print test %'\n' 输出: i '\n' am
而如果test = ' i %s am'
print test %'\n' 则输出:
i
am
%r 打印的是你写在脚本里的内容,%s打印出的是你应该看到的内容