[IPython-User] Hide/disable magic commands

Thomas Kluyver takowl@gmail....
Mon Sep 5 15:11:02 CDT 2011

On 2 September 2011 08:27, <matt.clarke@stfc.ac.uk> wrote:

> Is there a way to disable magic commands or at least hide them (i.e. they
> don’t show up on tab complete)?****
> ** **
> I am planning to use IPython as a command line for controlling experiments
> and do not want to give the users access to the power of magic commands as
> it would only result in trouble!

I don't know of anything official, but I think it should be possible to
disable them altogether:

ip = get_ipython()
del ip.magic_whatever

Note that this may not be future-proof, because at some point magic
functions will likely be moved to a separate object.

On a broader note, do think carefully about what you're removing - some
users might find certain magic commands quite useful, e.g.%run. Keeping them
hidden from tab completion seems like a better solution, but I don't know if
there's an easy way to do that.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110905/30392647/attachment.html 

More information about the IPython-User mailing list