try:
response=urllib2.urlopen(request,timeout=10)
except urllib2.HTTPError as e:
print e.code
fp=open('503.html','w')
fp.write(response.read())
fp.close()
return
想要处理一个 503 页面,输出到‘ 503.html ’文件。执行以上代码,显示 response 未指定。毕业设计,比较急,先谢谢了。
UnboundLocalError: local variable 'response' referenced before assignment
response=urllib2.urlopen(request,timeout=10)
except urllib2.HTTPError as e:
print e.code
fp=open('503.html','w')
fp.write(response.read())
fp.close()
return
想要处理一个 503 页面,输出到‘ 503.html ’文件。执行以上代码,显示 response 未指定。毕业设计,比较急,先谢谢了。
UnboundLocalError: local variable 'response' referenced before assignment