ipythontutor¶
%load_ext ipythontutor
%%ipythontutor
L1 = L2 = [1, 2, 3]
L1[1:2] = [100, 200, 300]
Loading...
a simple call to HTML()¶
a simpler example, where we produce our own HTML code programatically
def my_table(a,b,c,d):
return f"""
<table>
<tr><th>{a}</th><th>{b}</th></tr>
<tr><td>{c}</td><td>{d}</td></tr>
</table>
"""
# just checking
# my_table("student", "grade", "jean", 10)
# should render a table
from IPython.display import HTML
HTML(
my_table("student", "grade", "jean", 10)
)
Loading...
with HTML() from ipywidgets¶
from ipywidgets import HTML as ipyHTML
ipyHTML(my_table("student", "grade", "jean", 10))
Loading...