I want to return True if the list exactly matches the files in a given directory.
I want to return False if the directory contains files that are not in the list, and also if it only contains some but not all of...
Sorry for the thread necromancy, but I am in almost exactly the same situation as the OP. These solutions are not working for me. I don't know if it's because I'm having a brain eclipse, or what.
This:
Code:
len([f for f in os.listdir('.') if os.path.isfile(f)])
returns the correct number of files for the working directory. However,
Leave a comment: