原始字符串语法在字符串前加"r"
如
tem=r"h\c\d\n"
print(tem)
结果:h\c\d\n
注意:字符串结尾不能是\,否则报错,应对措施将\单列,然后拼接
如 tem=r"h\c\d\n""\\"
print(tem)
结果h\c\d\n\
原始字符串语法在字符串前加"r"
如
tem=r"h\c\d\n"
print(tem)
结果:h\c\d\n
注意:字符串结尾不能是\,否则报错,应对措施将\单列,然后拼接
如 tem=r"h\c\d\n""\\"
print(tem)
结果h\c\d\n\
转载于:https://www.cnblogs.com/GiraffaMPRO/p/6011837.html