Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

loop through files in a directory python

import os

for filename in os.listdir("/path/to/dir/"):
    if filename.endswith(".asm") or filename.endswith(".py"): 
         # print(os.path.join(directory, filename))
        continue
    else:
        continue
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #files #directory #python
ADD COMMENT
Topic
Name
3+1 =