[IPython-dev] Getting the Input History

Carl Smith carl.input at gmail.com
Wed Jan 18 13:49:40 EST 2017


Thank you Thomas. It seemed like I'd missed something.

Cheers,

-- Carl Smith
carl.input at gmail.com

On 18 January 2017 at 15:23, Thomas Kluyver <takowl at gmail.com> wrote:

> On 18 January 2017 at 14:09, Carl Smith <carl.input at gmail.com> wrote:
>
>> Is there a nice way to get the input history as a list?
>>
>
> Yep, it's accessible as _ih inside IPython. For a magic command or
> something, you can get it as: shell.history_manager.input_hist_raw
>
>
>> 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...
>>
>
> The %recall magic can already do something similar with a range of input
> numbers, e.g. %recall 1-3 5 7 should give you a new prompt with inputs 1-3,
> 5 and 7.
>
> Thomas
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170118/eba90710/attachment.html>


More information about the IPython-dev mailing list