-1

I've got a list of image urls, and want to display them in Jupyter. As it is ok for one single image, no image is displayed when looping over the list:

Here's the list:

liste_images = ['http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=447344&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=450248&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=447345&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=450252&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=469854&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=466953&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=469851&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=461108&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=461109&type=card',
 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=461107&type=card']

and the way I tried:

import requests
from IPython.display import Image
for url_image_carte in liste_images:
    Image(requests.get(url_image_carte).content)

Finally, the image from Jupyter session (individual image rendering is OK): enter image description here

david
  • 1,302
  • 1
  • 10
  • 21

1 Answers1

1

Just use IPython.display.display like so:

import requests
from IPython.display import Image, display
for url_image_carte in liste_images:
    display( Image(requests.get(url_image_carte).content) ) #added display
Anwarvic
  • 12,156
  • 4
  • 49
  • 69