Re: Getting the Input History
Carl Smith <[email protected]> Wed, 18 Jan 2017 18:49:40 +0000
| Newsgroups | gmane.comp.python.ipython.devel |
|---|---|
| Message-ID | <CAP-uhDc9+AuLJXX46bOiMWyBnH8ZHf01WMGC7QZE13iT7QGcAw@mail.gmail.com> |
Thank you Thomas. It seemed like I'd missed something. Cheers, -- Carl Smith [email protected] On 18 January 2017 at 15:23, Thomas Kluyver <[email protected]> wrote: > On 18 January 2017 at 14:09, Carl Smith <[email protected]> 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 > [email protected] > https://mail.scipy.org/mailman/listinfo/ipython-dev > > _______________________________________________ IPython-dev mailing list [email protected] https://mail.scipy.org/mailman/listinfo/ipython-dev