largestInt = float('-inf')
smallestInt = float('inf')
for line in integers:
    number = int(line)
if largestInt < number:
    largestInt = number
if smallestInt > number:
    smallestInt = number
How to find the smallest number in a text file (Python 2.5)