python中,有时没有用好 / 与 \ 就会出现错误。例如:
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-2: truncated \uXXXX escape
这是因为\被用为转义字符,正确表示记录路径有三种:
dir1=r‘C:\Users\10622\Desktop'
dir2=‘C:\\Users\\10622\\Desktop'
dir3=‘C:/Users/10622/Desktop'