Skip to content

Instantly share code, notes, and snippets.

@msukmanowsky
Created August 29, 2019 16:27
Show Gist options
  • Save msukmanowsky/3ca56edf5a4a43e9001327e8b931e096 to your computer and use it in GitHub Desktop.
Save msukmanowsky/3ca56edf5a4a43e9001327e8b931e096 to your computer and use it in GitHub Desktop.
import fileinput
for line in fileinput.input():
print(line)
"""
Usages
- Read from stdin: cat somefile | python script.py
- read from multiple files: python script.py file1.txt file2.txt file3.txt
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment