<div class="gmail_quote">On 2 September 2011 08:27, <span dir="ltr"><<a href="mailto:matt.clarke@stfc.ac.uk">matt.clarke@stfc.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<p class="MsoNormal">Is there a way to disable magic commands or at least hide them (i.e. they don’t show up on tab complete)?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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!</p></blockquote>
</div><br>I don't know of anything official, but I think it should be possible to disable them altogether:<br><br>ip = get_ipython()<br>del ip.magic_whatever<br><br>Note that this may not be future-proof, because at some point magic functions will likely be moved to a separate object.<br>
<br>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.<br>
<br>Thomas<br>