[IPython-User] show history without line number

Fernando Perez fperez.net@gmail....
Mon Oct 10 15:36:42 CDT 2011


Hi,

On Mon, Oct 10, 2011 at 9:42 AM, Chao YUE <chaoyuejoy@gmail.com> wrote:
> I know how to show history commands, but I just want to get rid of the line
> number that appears on the beginning of the command line... I guess there
> must be some way to do it...

as Min and Thomas said, that's the default behavior now, in 0.11.  If
you're on ipython 0.10, simply add '-n':

In [3]: hist
1: 3+4
2:
for i in range(3):
    print i,


3: _ip.magic("hist ")

In [4]: hist -n
3+4
for i in range(3):
    print i,


_ip.magic("hist ")
_ip.magic("hist -n")


We flipped that default around because the 'no numbers' case is
arguably the more useful one.

In general, for any ipython magic simply use '?' to get more help:

hist?

will show you the relevant options.

Best,

f


More information about the IPython-User mailing list