In ipython, we can use
_ih[32:39]
To show history lines between 32 and 39. How can I directly execute these history lines?
On recent versions of iPython you use the rerun magic-comand:
%rerun 32:39
Documentation on that command: http://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-rerun