Last active
October 26, 2020 23:36
-
-
Save kangasta/b159b958932ba30c5a0620195da79cf7 to your computer and use it in GitHub Desktop.
Python script to print out all txt files in folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This file is in the gist repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '''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