File: class/Workbook/Exercises/Lab8/unpack1.py

#!/usr/local/bin/python

import sys
marker = ':'*6

for line in sys.stdin.readlines():    # for all input lines
    if line[:6] != marker:
        print line,                   # write real lines
    else:
         sys.stdout = open(line[6:-1], 'w')



[Home page] Books Code Blog Python Author Train Find ©M.Lutz