Created
July 8, 2013 13:44
-
-
Save stevedoyle/5948882 to your computer and use it in GitHub Desktop.
Use fileinput to read input from files specified on the command line or stdin if no files specified.
This allows something like: cat foo.txt | bar.py
This file contains 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
import fileinput | |
for line in fileinput.input(): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment