SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 133-134: malformed

Reason for error: Reason: Windows can use \ to read files, but \ is used as an escape character in a string. After escaping, the resource of the path may not be found. For example, \t will be escaped as tab key

solution:

1. Replace it with an absolute path:
func1("C:\\Users\\renyc")

2. Explicitly declare the string without escaping (add r)
func1(r"C:\Users\renyc")

3. Use the Linux path /
func1("C:/Users/renyc")

Guess you like

Origin blog.csdn.net/weixin_61745097/article/details/128341256