python某步超时就跳过

import requests
import eventlet
eventlet.monkey_patch()
with eventlet.Timeout(2,False):
    r=requests.get("http://blog.csdn.net/happyanger6/article/details/54766559", verify=False)
    print('r')
print('aa')


Ref:

https://stackoverflow.com/questions/21965484/timeout-for-python-requests-get-entire-response
https://www.cnblogs.com/Security-Darren/p/4170031.html

你可能感兴趣的:(python某步超时就跳过)