Create wxBitmap from jpeg file

I’m trying to create a wx.Bitmap from a downloaded jpeg file (stored at ‘link’). The following code works, but I’m having to write the response out to a file and then load the file into the bitmap. I’m hoping for a way to use the result from memory without having to go through a file.

Is there a way to do this?
Thanks
Eric

req_response = request.urlopen(link)
response = req_response.read()

im_file = open('foo.jpg', 'wb')
im_file.write(response)
im_file.close()

bitmap = wx.Bitmap()
bitmap.LoadFile('foo.jpg', wx.BITMAP_TYPE_ANY)

Try:

io.BytesIO( b"..." )
wx.Image(stream, type=BITMAP_TYPE_ANY, index=-1)
wx.Bitmap(img, depth=BITMAP_SCREEN_DEPTH)

Just tried with a file:

data = open(r"C:\Users\xyz\Desktop\2018.jpg", "rb").read()
bitmap = wx.Bitmap( wx.Image( io.BytesIO( data ) ) )

Works perfectly! Thanks