Skip to content

Instantly share code, notes, and snippets.

@wh13371
Last active August 29, 2015 14:14
Show Gist options
  • Save wh13371/1f704f5cec13cfd11d01 to your computer and use it in GitHub Desktop.
Save wh13371/1f704f5cec13cfd11d01 to your computer and use it in GitHub Desktop.
python - chomp\strip stdin
#! /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