首页 > 开发 > Python > 正文

怎样防止对字符串变量的转义

2017-09-06 19:19:11  来源:网友分享

例如

temp1 = "\t"temp2 = r"\t"print repr(temp1)print repr(temp2)

输出:
't'
'\t'

有什么能对temp1用的方法可以让print repr(temp1)的结果和print repr(temp2)一样么

解决方案