Search code examples
pythonscrolljupyter-notebookstyling

Is there a way to make python showtraceback in jupyter notebooks scrollable?


Or if there are scrolling functionalities built in, to edit the scrolling settings?

I tried this but it didn't work --

def test_exception(self, etype, value, tb, tb_offset=None):
    try:
        announce = Announce(etype, value)
        if announce.print:
            announce.title()
            announce.tips()
            announce.resources()
            announce.feedback()
            announce.scroll(self, etype, value, tb, tb_offset)
        #self.showtraceback((etype, value, tb), tb_offset=tb_offset)
    except:
        self.showtraceback((etype, value, tb), tb_offset=tb_offset)
    def scroll(self, etype, value, tb, tb_offset=None):
        b=widgets.HTML(
        value=self.showtraceback((etype, value, tb), tb_offset=tb_offset),
        placeholder='Some HTML',
        description='Some HTML',
        disabled=True
        )
        a = HBox([b], layout=Layout(height='20px', overflow_y='10px'))
        display(a)

Solution

  • Try going to cell > current outputs > toggle scrolling in the Jupyter UI to enable scrolling output for a cell.