简体   繁体   English

如何修复 python 语法错误 unicodeescape 错误?

[英]How to fix python Syntax error unicodeescape error?

so I have a error after running this code, I have no idea what is wrong with it.所以运行此代码后出现错误,我不知道它有什么问题。 Could someone help me with that please?有人可以帮我吗?

You need to escape the \ in your path.您需要在路径中转义\ You can do that with \\ or with a raw string.您可以使用\\或原始字符串来执行此操作。

# Escape
path = "C:\\users\\something\\a"

# Or with a raw string
path = r"C:\users\something"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM