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

#!/usr/local/bin/python

import sys                      # load the system module
marker = ':'*6

for name in sys.argv[1:]:       # for all command arguments
    input = open(name, 'r')     # open the next input file
    print marker + name         # write a separator line
    print input.read(),         # write the file's contents



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