网络图片获取

import appuifw,e32,httplib

Conn=httplib.HTTPConnection("10.0.0.172", 80)
Conn.putrequest("GET",图片地址)
Conn.putheader('Accept', '*/*')
Conn.endheaders()
gif = Conn.getresponse().read()
gi=open("e:\\henryczq\\yzm.gif","w")
gi.write(gif)
gi.close()
img=Image.open("e:\\henryczq\\yzm.gif")
def handle_redraw(rect):
  canvas.blit(img)
canvas=appuifw.Canvas(redraw_callback=handle_redraw)
appuifw.app.body=canvas
appuifw.app.screen="normal"

e32.ao_sleep(5)

  

posted @ 2016-11-23 00:12  七月的尾巴_葵花  阅读(341)  评论(0编辑  收藏  举报