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)Python 传递函数名,布布扣,bubuko.com
Python 传递函数名
原文:http://blog.csdn.net/a_fengzi_code_110/article/details/24272675