import string from scanfile2 import scanner def processLine(line, count): print count, ':', string.upper(line) scanner("data.txt", processLine) # start scanner