Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python open directory and read files

import glob
for filename in glob.glob('*.txt'):
   with open(os.path.join(os.getcwd(), filename), 'r') as f: # open in readonly mode
      # do your stuff
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #open #directory #read #files
ADD COMMENT
Topic
Name
6+4 =