eg:
import requests
def get_key_info(response,*args,**kwargs):
#回调函数
print(xxxx + response.code)
def main():
requests.geturl('http://baidu.com', hooks = dict(response=get_key_info) )
main()
eg:
import requests
def get_key_info(response,*args,**kwargs):
#回调函数
print(xxxx + response.code)
def main():
requests.geturl('http://baidu.com', hooks = dict(response=get_key_info) )
main()
本文标题:python 钩子函数
本文链接:https://www.haomeiwen.com/subject/yydgjctx.html
网友评论