def pre_cmd(self): """Method called before executing each block. This one simply clears the screen.""" from IPython.utils.terminal import _term_clear _term_clear()