[SciPy-user] Ipython history and editing

Fernando Perez fperez.net@gmail....
Wed Sep 26 12:57:01 CDT 2007


[ Please note that these ipython-specific questions should be posted
on the ipython lists, not here ]

On 9/26/07, Jose Unpingco <unpingco@osc.edu> wrote:
>
>
>
> One of the greatest things about Ipython is the ability to use one's
> favorite editor to edit previous
> entires as in
>
> > íit _i18
>
> which would edit the 18th input in the history. The  annoying thing is that
> the so-edited command is not placed on the history, instead, the unuseful
>
> 22: _ip.magic("edit _i18")
>
> is put there. I would like the output of the post-edited command to show in
> the %hist list. By the way, I know I can get the post-edited output using
> Out[22], but I would really like to see it on the %hist list.
>
> Is this possible?

Use the '-r' switch to %hist:

In [1]: cd tmp/
/scratch/local/home/fperez/tmp

In [2]: ls
lih-wfns/  local/  matplotlib_tex.cache/  src@

In [3]: %hist
1: _ip.magic("cd tmp/")
2: _ip.system("ls -F ")
3: _ip.magic("hist ")

In [4]: %hist -r
1: cd tmp/
2: ls
3: %hist
4: %hist -r



Typing '%history?' will give you all the details on the use of
%history (%hist is just a shorthand for %history).

Cheers,

f


More information about the SciPy-user mailing list