Reputation: 2643
All I want to do is try some new codes in ipython notebook and I don't want to save it every time as its done automatically. Instead what I want is clear all the codes of ipython notebook along with reset of variables.
I want to do some coding and clear everything and start coding another set of codes without going to new python portion and without saving the current code.
Any shortcuts will be appreciated.
Note: I want to clear every cells code one time. All I want is an interface which appears when i create new python file, but I don't want to save my current code.
Upvotes: 9
Views: 16252
Reputation: 1
Just do Ctrl+A , this selects all the individual blocks/cells and then press d twice.
Upvotes: 0
Reputation: 44455
In Jupyter, do the following to clear all cells:
Esc
to enter command mode.Shift
. Select the first and last cells to select all cells.* 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)
Upvotes: 20
Reputation: 83
Press the scissors (cut) button multiple times for each cell you want to delete.
Upvotes: 1
Reputation: 449
You can type dd to remove current selected cell. And if you continously press dd you can clean the screen.
Upvotes: 1
Reputation: 565
Well, you could use Shift-M to merge the cells (from top) - at least there's only one left to delete manually.
Upvotes: 1
Reputation: 5
Ok youngster, I will break this down for ya in simple steps:
Glad to help
Upvotes: -3