[IPython-User] retrieve previous commands in notebook?

Paul Ivanov pivanov314@gmail....
Fri Apr 27 18:16:19 CDT 2012

On Fri, Apr 27, 2012 at 4:12 PM, Paul Ivanov <pivanov314@gmail.com> wrote:
> On Fri, Apr 27, 2012 at 3:59 PM, Fernando Perez <fperez.net@gmail.com> wrote:
>> On Fri, Apr 27, 2012 at 3:51 AM, Chao YUE <chaoyuejoy@gmail.com> wrote:
>>> Just a small question, in normal ipython shell I can use the upward arrow
>>> key to retrieve previous
>>> commands, is there a way to do this in notebook?
>> No, we don't have any tools to retrieve history from the notebook side
>> yet, I'm afraid.  You can however copy entire cells, see the Edit menu
>> and keyboard shortcuts for how to do it.  It's not the same, but
>> remains useful in many cases.
> What about just using this:
>  get_ipython().set_next_input(_i)
> That works here. We should probably amend loadpy to let it take strings,
> and not just filenames. In that case, the above would just simplify to
>  %loadpy _i

I should have clarified that the above fetches the last command and puts it
into a new cell below wherever you run it. To get some other arbitrary In[]
prompt, use:


which is the same as


Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

More information about the IPython-User mailing list