Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

iterate through all files in directory python

import os
directory = 'the/directory/you/want/to/use'

for filename in os.listdir(directory):
    if filename.endswith(".txt"):
      #do smth
      continue
    else:
    continue
Source by carrefax.com #
 
PREVIOUS NEXT
Tagged: #iterate #files #directory #python
ADD COMMENT
Topic
Name
1+3 =