python里的r?
例如:
test = """hello,\nworld""" print "this is test1: %s" %test print "this is test2: %r" %test輸出: this is test1: hello, world this is test2: 'hello,\nworld'由此可見,在python中格式化字符%r,表示打印的是對象,什么都打印python里的r?
例如:
test = """hello,\nworld""" print "this is test1: %s" %test print "this is test2: %r" %test輸出: this is test1: hello, world this is test2: 'hello,\nworld'由此可見,在python中格式化字符%r,表示打印的是對象,什么都打印