# sumfile1.py
# Written by Todd Wareham for CS 2500
"""
Given the name of a file of integers as a command-line argument, computes and
 prints the number and total of positive non-zero integers in this file.

This version is implemented using for-loops and a continue-statement.
"""

import sys

if len(sys.argv) != 2:
    print "usage: ", sys.argv[0], " filename"
    sys.exit(1)

sum = numPInt = 0

for line in open(sys.argv[1]):
    for num in line.split():
        if (int(num) <= 0): continue
        sum = sum + int(num)
        numPInt = numPInt + 1

print "sum, # +ve int = ", sum, ",", numPInt

