-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.html
71 lines (53 loc) · 1.55 KB
/
output.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<html lang="en">
<head>
<meta charset="utf-8">
<title>thebe widget testing</title>
<!-- script that allows the line plots to be displayed, otherwise it gives an error -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<!-- Thebe configuration !-->
<script type="text/x-thebe-config">
{
binderOptions: {
repo: "LibreTexts/default-env",
ref: "2.3.2",
binderUrl: "https://binder.libretexts.org"
},
kernelOptions: {
name: "python3",
},
requestKernel: true,
bootstrap: true,
}
</script>
<!-- thebe javascript bundle -->
<script src="https://unpkg.com/thebe@latest/lib/index.js"></script>
</head>
<body>
<!-- source from https://github.com/jupyter-widgets/ipywidgets/blob/master/ipywidgets/widgets/widget_output.py -->
<pre data-executable="true" data-language="python">
import ipywidgets as widgets
from IPython.display import display
out = widgets.Output()
display(out)
</pre>
<pre data-executable="true" data-language="python">
print('prints to output area')
</pre>
<pre data-executable="true" data-language="python">
with out:
print('prints to output widget1')
</pre>
<pre data-executable="true" data-language="python">
@out.capture()
def func():
print('prints to output widget2')
func()
</pre>
<pre data-executable="true" data-language="python">
</pre>
<pre data-executable="true" data-language="python">
</pre>
<pre data-executable="true" data-language="python">
</pre>
</body>
</html>