Last active
June 1, 2020 00:48
-
-
Save pararang/4dbea2f8c729928fdb3c8352d320b9ec to your computer and use it in GitHub Desktop.
Revisions
-
pararang revised this gist
Jun 1, 2020 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ import os my_list = "" directory_list = os.listdir() with open("selected-images.txt", "w", encoding="utf-8") as file: for dir in directory_list: if os.path.isdir(dir) == False: continue my_list += '------ START OF ' + dir + " ------\n" for eachfile in os.listdir(dir): if eachfile.lower().endswith(('.png', '.jpg', '.jpeg')) == False: continue my_list += eachfile + "\n" my_list += '------ END OF ' + dir + " ------\n\n" file.write(my_list) -
pararang created this gist
Jun 1, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ import os mylist = "" dirList = os.listdir() with open("selectedforalbum.txt", "w", encoding="utf-8") as file: for dir in dirList: if os.path.isdir(dir) == False: continue mylist += '------ START OF ' + dir + " ------\n" for eachfile in os.listdir(dir): if eachfile.lower().endswith(('.png', '.jpg', '.jpeg')) == False: continue mylist += eachfile + "\n" mylist += '------ END OF ' + dir + " ------\n\n" file.write(mylist)