You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to make an output context widget exportable to pain-text. Overriding __repr__ doesn't work. Simple example:
# In [1]:fromipywidgetsimportOutputfromIPythonimportdisplayasdispclassMyOutput(Output):
def__init__(self):
super(Output, self).__init__()
self.last_display="Nothing to display yet"def__repr__(self):
returnrepr(self.last_display)
out1=MyOutput()
disp.display(out1) # display in `Out[1]`# In [2]:without1: # use `Out[1]`disp.clear_output(True)
disp.display("Some text!")
This correctly displays 'Some text!' in Out[1], but when exported shows 'Nothing to display yet'. If __repr__ is not overridden, exported versions just show Output().
Trying to make an output context widget exportable to pain-text. Overriding
__repr__
doesn't work. Simple example:This correctly displays
'Some text!'
inOut[1]
, but when exported shows'Nothing to display yet'
. If__repr__
is not overridden, exported versions just showOutput()
.Any idea how to create an
Output
context with manually controlled exportrepr
? Should we be using_repr_mimebundle_
from https://ipython.readthedocs.io/en/stable/api/generated/IPython.display.html#IPython.display.display or https://ipypublish.readthedocs.io/en/latest/code_cells.html#object-output-formats ? Seems extreme and also doesn't seem to work for anOutput
context widget.The text was updated successfully, but these errors were encountered: