[IPython-User] Hide/disable magic commands

Fernando Perez fperez.net@gmail....
Fri Sep 9 11:59:50 CDT 2011


On Fri, Sep 9, 2011 at 6:19 AM,  <matt.clarke@stfc.ac.uk> wrote:
> 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.file_matches,
>
>                          self.magic_matches, <- delete this
>
>                          self.alias_matches,
>
>                          self.python_func_kw_matches,
>
>                          ]

Note that you can do this at runtime without having to hack the code:

ip = get_ipython()
ip.Completer.matchers.remove(ip.Completer.magic_matches)

You can put this into the profile for your users, enabling you to do
this customization while being able to update ipython normally.
Carrying a modified code is always a higher maintenance burden.

Cheers,

f


More information about the IPython-User mailing list