I want to work with paths in Windows in Python 3.3, but I have an error:
FileNotFoundError: [Errno 2] No such file or directory: \'E:\\\\dir\\\\.
Changing '\\' for '/' worked for me. I created a directory named 'a' in C:/ for this example.
>>> (Python interpreter)
>>> import os
>>> os.path.isdir('C:/a/)')
>>> True
>>> os.path.isfile('C:/a/)')
>>> False
If you are using a raw-string, then you do not escape backslashes:
f(r'E:\dir')
Of course, this problem (and many others like it) can be solved by simply using forwardslashes in paths:
f('E:/dir')