[IPython-dev] %rep implemented

Ville M. Vainio vivainio at gmail.com
Fri May 25 13:55:05 EDT 2007


I implemented a (somewhat simpler than initially anticipated) version
of %rep in svn. It's in IPython.maghistory

Here's the docstring:

    r""" Repeat a command, or get command to input line for editing

    - %rep (no arguments):

    Place a string version of last input to the next input prompt. Allows you
    to create elaborate command lines without using copy-paste::

        $ l = ["hei", "vaan"]
        $ "".join(l)
        ==> heivaan
        $ %rep
        $ heivaan_ <== cursor blinking

    %rep 45

    Place history line 45 to next input prompt. Use %hist to find out
the number.

    %rep 1-4 6-7 3

    Repeat the specified lines immediately. Input slice syntax is the same as
    in %macro and %save.

    """

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'



More information about the IPython-dev mailing list