Python中转义字符\的使用
- 在字符串中出现
\时(如WIN下文件的路径),可使用r"string"来取消\的转义作用,也可使用下面的方法:
r'C:\Users\expoperialed\Desktop\Python'
'C:\\Users\\expoperialed\\Desktop\\Python'
'C:/Users/expoperialed/Desktop/Python'
\的使用\时(如WIN下文件的路径),可使用r"string"来取消\的转义作用,也可使用下面的方法:r'C:\Users\expoperialed\Desktop\Python'
'C:\\Users\\expoperialed\\Desktop\\Python'
'C:/Users/expoperialed/Desktop/Python'
本文标题:Python字符串
本文链接:https://www.haomeiwen.com/subject/wwzcbxtx.html
网友评论