Skip to content

Instantly share code, notes, and snippets.

@kangasta
Last active October 26, 2020 23:36
Show Gist options
  • Select an option

  • Save kangasta/b159b958932ba30c5a0620195da79cf7 to your computer and use it in GitHub Desktop.

Select an option

Save kangasta/b159b958932ba30c5a0620195da79cf7 to your computer and use it in GitHub Desktop.
Python script to print out all txt files in folder
This file is in the gist repository.
'''Script to print out all txt files in CWD
'''
from os import listdir
from os.path import isfile, join
for filename in listdir('.'):
if isfile(filename) and filename.endswith('.txt'):
with open(filename, 'r') as f:
print(f.read())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment