Is there a simple alternative to os.listdir that returns a text file of image sizes (height, width, MB) as well as document name?
I wondered if there was some enhanced version of os.listdir hidden in some Python Library?
I WOULD LIKE TO CREATE A TEXT FILE CONTAINING:
Document name, size in MB, Image width, image height in pixels
MY CODE SO FAR
I can get a text file containing all document names in a directory (see code below).
(It works but doesn't give enough info!)
Thanks in advance.
(Novice)
I wondered if there was some enhanced version of os.listdir hidden in some Python Library?
I WOULD LIKE TO CREATE A TEXT FILE CONTAINING:
Document name, size in MB, Image width, image height in pixels
MY CODE SO FAR
I can get a text file containing all document names in a directory (see code below).
(It works but doesn't give enough info!)
1 2 3 4 5 6 7 8 9 10 |
gDir = "D:/family2022/" # Now get a text list of the photos to check. photosToCheck = "OriginalSourceForPhotos" if os.path.exists(gDir + photosToCheck) : gListPhotoRecs = os.listdir(gDir + photosToCheck) print (gListPhotoRecs) else : print ( "Missing folder containing photos to check!" ) input ( "Press ENTER" ) |
(Novice)
buran write Feb-17-2023, 06:45 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.