Jupyter 显示多张图片
Jupyter display several images
我有一个图像 url 列表,想在 Jupyter 中显示它们。
由于单张图片可以,循环列表时没有显示图片:
列表如下:
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']
以及我尝试的方式:
import requests
from IPython.display import Image
for url_image_carte in liste_images:
Image(requests.get(url_image_carte).content)
最后,来自Jupyter session的图片(单图渲染即可):
像这样使用IPython.display.display
:
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
我有一个图像 url 列表,想在 Jupyter 中显示它们。 由于单张图片可以,循环列表时没有显示图片:
列表如下:
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']
以及我尝试的方式:
import requests
from IPython.display import Image
for url_image_carte in liste_images:
Image(requests.get(url_image_carte).content)
最后,来自Jupyter session的图片(单图渲染即可):
像这样使用IPython.display.display
:
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