ipywidgets
ipywidgets copied to clipboard
ipywidget Output to text file
trafficstars
Is there a way to capture ipywidget output and direct to a file? eg
nout = ipywidgets.Output()
with nout:
print("hi there")
and instead of "hi there" going to the display... directing to a file? The 'print' is just an example. I want to capture 'warnings' coming from initializing complex objects to a file.
Credit goes to @bollwyvl for looking at this during our triage call. You could use json.dumps(nout.outputs). There are a couple of things you could do in addition to the suggestion here - one of them would be to use the observe event handler to call some function whenever the outputs traitlet is changed.