0

On repl.it, I tried to call the path I know it exists, but it gave me an error.

Code:

import os
print os.path.exists('C:\Users\')

Error:

SyntaxError: EOL while scanning string literal
exited with non-zero status
KubiK888
  • 4,377
  • 14
  • 61
  • 115

1 Answers1

0

You need to escape your backslashes. See the documentation here.

import os
print os.path.exists('C:\\Users\\')
stelioslogothetis
  • 9,371
  • 3
  • 28
  • 53