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!)
(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!)
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")Thanks in advance.(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.
