Skip to content

Instantly share code, notes, and snippets.

@ricklentz
Created June 7, 2017 22:29
Show Gist options
  • Select an option

  • Save ricklentz/2acbcae1a9161d80893a261d01042918 to your computer and use it in GitHub Desktop.

Select an option

Save ricklentz/2acbcae1a9161d80893a261d01042918 to your computer and use it in GitHub Desktop.
import os
dir = r'/home/...'
for filename in os.listdir(dir):
with open(dir + '/' + filename, encoding='utf-8') as f:
for idx, line in enumerate(f):
print(filename + ' ' + str(idx))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment