[IPython-User] [IPython-user] can't define magic for "cls"

Phillip Feldman phillip.m.feldman@gmail....
Thu Sep 22 22:10:00 CDT 2011


Hm.  Putting this into the ipy_user_conf.py file doesn't seem to have any
effect.

I also tried issuing the following from the IPython prompt:

In [5]: import IPython
In [6]: ip= IPython.ipapi.get()
--------------------------------------------------------
AttributeError                            Traceback (mos
AttributeError: 'module' object has no attribute 'ipapi'

On Wed, Sep 21, 2011 at 3:20 PM, Fernando Perez <fperez.net@gmail.com>wrote:

> On Tue, Sep 20, 2011 at 9:15 AM, Dr. Phillip M. Feldman
> <Phillip.M.Feldman@gmail.com> wrote:
> >
> > I would like to define a "magic" that clears the screen.  I added the
> > following to my ipy_user_conf.py file, to no avail:
> >
> > ip.expose_magic("cls", os.system("cls")
> >
> > Any suggestions will be appreciated.
>
>
> ip.expose_magic("cls", lambda self, s: os.system("cls"))
>
> should do for ipython 0.10.x that you are using.
>
> Cheers,
>
> f
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110922/e132a93f/attachment.html 


More information about the IPython-User mailing list