Search code examples
pythoncelljupyter-notebookjupyter

Stop Jupyter notebook from generating new blank cells after every alt-enter (run)


I am new to Jupyter notebooks. I have got into a habit of keeping parts of my code in different cells. Now every time a run a cell a new cell is added right after the last cell. So after a few runs I have many blank cell. Is there a way to restrict Jupyter notebooks to only keep one black cell whenever we run a code (as in not generate new blank cell when a old black cell exists right after the last cell)?

Screenshot: Keep only one blank cell after

from utils import *

enter image description here


Solution

  • use shift enter instead of alt enter