URL -> wxImage ?

Paul McNett wrote:

James Carroll writes:

Does any kind soul have an example of python that
loads a wxImage from a URL?

import urllib, wx

url = 'http://www.happycookers.com/images/1-1402.jpg
file = urllib.urlretrieve(url)
image = wx.Image(file[0])

You can also use wx.ImageFromStream if you want to avoid writing to a physical file. You just need to pass it a Python file-like object and it will load the image directly from that stream.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!