File: class/Workbook/Examples/Lecture5/scanfile.py

def scanner(name, function):
    file = open(name, 'r')          # create file
    for line in file.readlines():
        function(line)              # call function
    file.close()



[Home page] Books Code Blog Python Author Train Find ©M.Lutz