Maison  >  Questions et réponses  >  le corps du texte

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

例如

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

输出:
't'
'\t'

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

PHP中文网PHP中文网2741 Il y a quelques jours536

répondre à tous(1)je répondrai

  • PHP中文网

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

    répondre
    0
  • Annulerrépondre