import string from scanfile import scanner count = 0 def processLine(line): global count count = count+1 print count, string.upper(line) scanner("data.txt", processLine) # start scanner