Question

timeout!!!???

def fix_timeout(n):
	#start time
	timeout = n
	start = time.time()

	try:
		req = urllib.request.Request('https://www.saatchiart.com/')
		a = urllib.request.urlopen(req,timeout = timeout).read()
		
		#end time
		end = time.time()
		print(str(end-start))
	except Exception as e:
		print("failed")
		raise e

Multithreading!!!???

posted @ 2017-12-21 16:26  屋中人  阅读(150)  评论(0编辑  收藏  举报
返回顶部