I'm currently writing a script which has to check if all specified folders actually exist.
I found out I have to use os.path.isdir() with absolute paths.
I have the following directory structure:
X:
pythonscripts
files
Films
Series
src
When I open op my python command line and try if the folders actually exist, I get the following:
>>> import os
>>> os.path.isdir('X:pythonscriptssrc')
True
>>> os.path.isdir('X:pythonscriptsfiles')
False
>>> os.path.isdir('X:pythonscriptsfilesFilms')
False
>>> os.path.isdir('X:pythonscriptsfilesSeries')
False
Which is odd, because when I copy and paste these paths into Windows Explorer, I can access them without problems. I checked permissions and all folders have the same permissions on them. Does anyone know what I'm doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…