python - 怎样防止对字符串变量的转义
本文介绍了python - 怎样防止对字符串变量的转义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
例如
temp1 = "\t"
temp2 = r"\t"
print repr(temp1)
print repr(temp2)
输出:
't'
'\t'
有什么能对temp1用的方法可以让print repr(temp1)的结果和print repr(temp2)一样么
解决方案
这篇关于python - 怎样防止对字符串变量的转义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文