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()