Skip to content

Instantly share code, notes, and snippets.

@pbojinov
Last active April 8, 2018 02:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pbojinov/a979139fbe48e70ce21367de98da6844 to your computer and use it in GitHub Desktop.
Save pbojinov/a979139fbe48e70ce21367de98da6844 to your computer and use it in GitHub Desktop.
Display External Images in Python
from IPython.display import display, HTML
images = [
"https://d1dwct2onyzkdl.cloudfront.net/720/120059691016_605718478856.jpg",
"https://d1dwct2onyzkdl.cloudfront.net/720/120059691016_605718609928.jpg",
"https://d1dwct2onyzkdl.cloudfront.net/720/120059691016_605718708232.jpg"
]
def make_html(src):
return '<img src="{}" width="50" height="50" style="display:inline;margin:1px"/>'.format(src)
result = [''.join(make_html(x)) for x in images]
display(HTML(''.join(result)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment