ipython notebook clear all code
In Jupyter, do the following to clear all cells:
- Press
Esc
to enter command mode. - Hold
Shift
. Select the first and last cells to select all cells.* - Press
d
twice to delete all selected cells.
Alternatively, if you simply want to try out code, consider running the ipython
console, which is purely interactive in the REPL and does not require creating a new file. In a command prompt, type:
> ipython
Demo
Click outside the textbox to select a cell in command mode (thanks @moondra's).
Command Mode (Yes)
Edit Mode (No)
You can type dd to remove current selected cell. And if you continously press dd you can clean the screen.
Well, you could use Shift-M to merge the cells (from top) - at least there's only one left to delete manually.