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