-
-
Save ontouchstart/ea1631f69e507a81a9d9ec56b79e4d11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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
This notebook can be viewed in
https://nbviewer.jupyter.org/gist/ontouchstart/ea1631f69e507a81a9d9ec56b79e4d11