File tree Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ much richer output than mere text; plots, for example:
56
56
from matplotlib import pyplot
57
57
%matplotlib inline
58
58
59
- x = np.linspace(0 , 2 * np.pi)
59
+ x = np.linspace(1E-3 , 2 * np.pi)
60
60
61
61
pyplot.plot(x, np.sin(x) / x)
62
62
pyplot.plot(x, np.cos(x))
@@ -155,16 +155,40 @@ a list of error types; if an error is raised that is not in the list then execut
155
155
:raises: KeyError, ValueError
156
156
157
157
a = {'hello': 'world!'}
158
- a['jello ']
158
+ a['hello ']
159
159
160
160
produces:
161
161
162
162
.. jupyter-execute ::
163
163
:raises: KeyError, ValueError
164
164
165
165
a = {'hello': 'world!'}
166
- a['jello ']
166
+ a['hello ']
167
167
168
+ Additionally, any output sent to the ``stderr `` stream of a cell will result in jupyter-sphinx
169
+ raising an exception. This behaviour can be suppressed (and the ``stderr `` stream printed as regular
170
+ output) by providing the ``stderr `` option::
171
+
172
+ .. jupyter-execute::
173
+ :stderr:
174
+
175
+ import sys
176
+
177
+ print("hello, world!", file=sys.stderr)
178
+
179
+ produces:
180
+
181
+ .. jupyter-execute ::
182
+ :stderr:
183
+
184
+ import sys
185
+
186
+ print("hello, world!", file=sys.stderr)
187
+
188
+ .. warning ::
189
+
190
+ Note that output written to ``stderr `` is not displayed any differently than output written
191
+ to ``stdout ``.
168
192
169
193
Controlling the execution environment
170
194
-------------------------------------
You can’t perform that action at this time.
0 commit comments