Thursday, June 14, 2018

Python: loop files in directory

for filename in os.listdir(directory):
    if filename.endswith(".asm") or filename.endswith(".py"):
        # print(os.path.join(directory, filename))
        continue
    else:
        continue

Reference: How can I iterate over files in a given directory?

No comments: