Created
November 29, 2016 16:16
-
-
Save GaryLee/52b48224de4e1edaef6cbddb83e4bfdc to your computer and use it in GitHub Desktop.
List all text files.
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
| #!python | |
| import glob | |
| for fn in glob.glob('*.txt'): | |
| with open(fn, 'r') as fd: | |
| for ln, content in enumerate(fd): | |
| print '%s:%d> %s' % (fn, ln, content), | |
| print '\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment