Python 传递函数名

发布时间:2019-09-12 07:57:28编辑:auto阅读(1859)



    def resolve(fileObject,lineHandler):
    for line in fileObject :
    lineHandler(line)


    def lineHandlerFun(line) :
    print line




    file = open('C:\Windows\System32\drivers\etc\hosts')
    resolve(file,lineHandlerFun)

关键字