# sqfile2.py
# Written by Todd Wareham for CS 2500
"""
Given the name of a file of integers (with zero or more integers per line)
 as a command-line argument, prints the squares of all integers in that file.
"""

import sys

if len(sys.argv) == 1:
    print "usage: python", sys.argv[0], "filename1 filename2 ..."
    sys.exit(1)

for line in open(sys.argv[1], "r"):
    for x in line.split():
        print "The square of ", int(x), " is ", int(x) * int(x)
