Getting the Input History

Carl Smith <[email protected]> Wed, 18 Jan 2017 14:09:33 +0000
Newsgroups gmane.comp.python.ipython.devel
Message-ID <CAP-uhDcLsv4y9vv5-1tO2RyFrahh1Re8UcdJYwgFmGYriYaxJA@mail.gmail.com>
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
[email protected]

_______________________________________________
IPython-dev mailing list
[email protected]
https://mail.scipy.org/mailman/listinfo/ipython-dev