Created
June 26, 2021 09:19
-
-
Save nbswords/c1b10a91064b8c90f9a4390e0c568e24 to your computer and use it in GitHub Desktop.
This file contains 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 characters
import os | |
image_files = [] | |
os.chdir(os.path.join("data", "test")) | |
for filename in os.listdir(os.getcwd()): | |
if filename.endswith(".jpg"): | |
image_files.append("data/test/" + filename) | |
os.chdir("..") | |
with open("test.txt", "w") as outfile: | |
for image in image_files: | |
outfile.write(image) | |
outfile.write("\n") | |
outfile.close() | |
os.chdir("..") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment