python raw String 获取字符串变量中的反斜杠
常用的获取raw string的方式为:
>>>r'\n'
\n
不能用在字符串变量中,获取字符串变量中的反斜杠如下:
tab = '\n'
>>>tab.encode('string-escape')
\n
posted on 2016-12-14 12:40 LebronZhang 阅读(859) 评论(0) 编辑 收藏 举报
常用的获取raw string的方式为:
>>>r'\n'
\n
不能用在字符串变量中,获取字符串变量中的反斜杠如下:
tab = '\n'
>>>tab.encode('string-escape')
\n
posted on 2016-12-14 12:40 LebronZhang 阅读(859) 评论(0) 编辑 收藏 举报