Created
June 25, 2014 09:01
-
-
Save migonzalvar/248c788574b2973e4073 to your computer and use it in GitHub Desktop.
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
#! /usr/bin/env python3 | |
""" tee.py - Tee a file. """ | |
import sys | |
# Parse arguments | |
file_name = sys.argv[1] | |
with open(file_name, 'wt') as file_out: | |
for n, line in enumerate(sys.stdin): | |
file_out.write(line) | |
sys.stdout.write(line) | |
#sys.stderr.write('%d lines\n' % n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment