Spaces:
Sleeping
Sleeping
File size: 508 Bytes
e560475 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import pickle as pickle
import os
filenames = []
# Sort the folder names
folder_names = sorted(['images1', 'images2', 'images3', 'images4', 'images5'])
# Iterate over sorted folder names
for folder_name in folder_names:
# Iterate over files in each folder
for file in os.listdir(folder_name):
# Check if the file is not a shortcut (.lnk)
if not file.endswith('.lnk'):
filenames.append(os.path.join(folder_name, file))
pickle.dump(filenames,open('filepath.pkl','wb'))
|