How to hide ERROR messages in Jupyter Notebook?

Viewed 7844

Is there any way to hide error messages from a jupyter notebook? I want to take notes from a class and write down some snippets of code but of course the code doesn't actually run. Is there any way to hide error messages (rather than warning messages)?

Thanks so much!

2 Answers

The fastest way to get syntax highlighting if you've already accidentally run the cell is simply press

my

in Command mode.

m converts to Raw NBConvert, the error disappears

y converts back to code, with the error now gone

1st option: just not run the cell, or if you accidentally did run the cell you could use cell -> All Output -> Clear from the drop down menu.

2nd option: Change the cell type to 'Raw NBConvert'. However this removes syntax highlighting as well.

Related