'how to force all print output after last cell in jupyter notebook?

I am using jupyter notebook with plotly-dash. How to force all print output in different functions or callbacks after last cell of below app.run_server? Otherwise, I have to scroll-up to different cells to check printing output and error message.

here is my last cell.

if __name__ == "__main__":
    app.run_server(mode='external',debug=True,port=8050)

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source