Last active
August 29, 2015 14:14
-
-
Save wh13371/1f704f5cec13cfd11d01 to your computer and use it in GitHub Desktop.
python - chomp\strip stdin
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
#! /usr/bin/python | |
import sys | |
""" | |
usage: cat dogs_breakfast.py | ./chomp_stdin.py > dogsnuts.py | |
"chomp" noise from each line, half useful if you want to drop ALL formatting\identation | |
""" | |
def main(): | |
for line in sys.stdin: | |
str = line.strip() | |
print (str) | |
if __name__ == "__main__": | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment