Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在repl.it 上,我试图调用我知道它存在的路径,但它给了我一个错误。
代码:
import os print os.path.exists('C:\Users\')
错误:
SyntaxError: EOL while scanning string literal exited with non-zero status
你需要逃避你的反斜杠。请参阅此处的文档。
import os print os.path.exists('C:\\Users\\')