img_req=urllib2.Request(Img_URL)
img_response=opener.open(img_req)
try:
out=open('code','wb')
#print img_response.read()
out.write(img_response.read())
out.flush()
out.close()
print 'get code success'
except IOError:
print 'file wrong'
img_req=urllib2.Request(Img_URL)
img_response=opener.open(img_req)
try:
out=open('code','wb')
#print img_response.read()
out.write(img_response.read())
out.flush()
out.close()
print 'get code success'
except IOError:
print 'file wrong'