%r是repr
%s就是str
比如\x27是单引号
>>> print '%r'%'\x27' # 带括号的单引号
"'"
>>> print '%s'%'\x27' # 纯单引号
'
>>> class Example(object):
... __repr__ = lambda cls: '<Demo>(repr)'
... __str__ = lambda cls: '<Demo>(str)'
...
>>> example = Example()
>>> print '%s'%example
<Demo>(str)
>>> print '%r'%example
<Demo>(repr)