import os path = "./sample" os.path.exists(path)
Now you can see the existence of a file or directory named sample.
By the way, if you want to check only the files without including the directory,
If you don't want to include files and just want to see the directory
Can be done with