[IPython-dev] Getting the Input History

Carl Smith carl.input at gmail.com
Wed Jan 18 09:09:33 EST 2017


Hi there,

Is there a nice way to get the input history as a list? Currently, it seems
that the only way is to write the history to a file, then read it back in
from there.

I'd like to create a magic, named something like *squash*, that basically
combines the previous *n* inputs into a single string that can then be
edited as one input. For example, entering these three lines...

*In[1]:* *a = b*
*In[2]:* *c = d*
*In[3]:* *squash 2*

...would automatically create something like this:

*In[4]:* *a = b*
*.....:* *c = d*

I'm not too bothered if writing to a file is the only way to do it, but
just thought I'd ask here first, just in case I missed something.

Cheers,
-- Carl Smith
carl.input at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170118/bf6508fc/attachment.html>


More information about the IPython-dev mailing list