설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

prdiction.py 808B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Python program to check if
  2. # a directory contains file
  3. import os
  4. # directoryPath = "Copy_Gallery"
  5. # for root, dirs, files in os.walk(directoryPath):
  6. # for name in files:
  7. # f = os.path.join(root, name)
  8. # print(type(f))
  9. # # if len(f)==568:
  10. # # print("none")
  11. # # else:
  12. # # print("yes")
  13. # Python program to check whether
  14. # the directory empty or not
  15. import os
  16. # path of the directory
  17. path = "Copy_Gallery"
  18. # Getting the list of directories
  19. dir = os.listdir(path)
  20. # Checking if the list is empty or not
  21. if len(dir) == 0:
  22. print("Empty directory")
  23. else:
  24. print("Not empty directory")
  25. import glob
  26. from os import listdir
  27. for f in glob.glob("Copy_Gallery/*"):
  28. if len(os.listdir(f))==0:
  29. print("file not found")
  30. else:
  31. print("file found")