Home  >  Q&A  >  body text

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

例如

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

输出:
't'
'\t'

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

PHP中文网PHP中文网2741 days ago542

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 10:18:29

    reply
    0
  • Cancelreply