Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ontouchstart
Last active December 12, 2018 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ontouchstart/ea1631f69e507a81a9d9ec56b79e4d11 to your computer and use it in GitHub Desktop.
Save ontouchstart/ea1631f69e507a81a9d9ec56b79e4d11 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import requests
class Test:
def _repr_html_(self):
return "<h1>Test</h1>"
class ChessBoard:
def _repr_html_(self):
url = 'https://gist.githubusercontent.com/ontouchstart/d753ff109f591995f399fe5425f0c005/raw/6d2b9e1e016cea1b0d4c1f793b4aa18e7dd53cac/chessboard.svg'
with requests.get(url) as response:
html = response.content.decode('utf-8')
return html
@ontouchstart
Copy link
Author

ontouchstart commented Dec 11, 2018

@ontouchstart
Copy link
Author

You can also load the code to another notebook on Google Colab and play with it yourself.

https://colab.research.google.com/gist/ontouchstart/934da948842bff86d470ffe25d692e67/test.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment