python实现tee命令
来源:岁月联盟
时间:2012-08-05
import sys
class _tee(file):
def write(self, text):
sys.stdout.write(text)
file.write(self, text)
line = sys.stdin.readline()
t = _tee(sys.argv[2], "a")
t.write(line) # for write
#print >> t, line # for print
上一篇:python urllib