aim = {
"official" : r"D:\下载\Temp\official\",
"others" : r"D:\下载\Temp\others\"
}

aim = {
"official" : r"D:\下载\Temp\official\",
"others" : r"D:\下载\Temp\others\"
}

|
DvelNov 6, 2021
1
原生字符串的结尾不能是 “反斜杠” + “引号” 。
可以写成 r'D:\下载\Temp\official' + '\\' |
|
festoney8Nov 6, 2021
2
|
|
leoleoasdNov 6, 2021
3
根据 python 文档:Even in a raw literal, quotes can be escaped with a backslash, but the backslash remains in the result; for example, r"\"" is a valid string literal consisting of two characters: a backslash and a double quote; r"\" is not a valid string literal (even a raw string cannot end in an odd number of backslashes). Specifically, a raw literal cannot end in a single backslash (since the backslash would escape the following quote character). Note also that a single backslash followed by a newline is interpreted as those two characters as part of the literal, not as a line continuation.
|
|
Trim21Nov 6, 2021 via Android
5
只有最后一个反斜杠会失效
|
|
6
谢谢楼上的各位
|
|
2i2Re2PLMaDnghLNov 6, 2021
7
这是为了让 syntax 简单,把 raw 放到 semantic 层来实现。
|