[IPython-User] Hide/disable magic commands
Fri Sep 9 08:19:44 CDT 2011
I have found a simple way of eliminating magic commands from tab complete but still allow the commands to be used by editing completer.py.
# All active matcher routines for completion
self.matchers = [self.python_matches,
self.magic_matches, <- delete this
From: Thomas Kluyver [mailto:firstname.lastname@example.org]
Sent: 05 September 2011 21:11
To: Clarke, Matt (STFC,RAL,ISIS)
Subject: Re: [IPython-User] Hide/disable magic commands
On 2 September 2011 08:27, <email@example.com<mailto:firstname.lastname@example.org>> 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()
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.
Scanned by iCritical.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User