Python not recognising directories os.path.isdir() [duplicate]

You need to create the full path name before checking:

if not os.path.isdir(os.path.join(path, each)):
  ...

Leave a Comment