You are viewing an older version (9.3.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.3.0 / IPython / core / magic / Magics

MetaHasTraits

IPython.core.magic:Magics

source: /IPython/core/magic.py :527

Signature

def   Magics ( shell = None ** kwargs )

Members

Summary

Base class for implementing magic functions.

Extended Summary

Shell functions which can be reached as %function_name. All magic functions should accept a string, which they can parse for their own needs. This can make some functions easier to type, eg %cd ../ vs. %cd("../")

Classes providing magic functions need to subclass this class, and they MUST:

  • Use the method decorators @line_magic and @cell_magic to decorate individual methods as magic functions, AND

  • Use the class decorator @magics_class to ensure that the magic methods are properly registered at the instance level upon instance initialization.

See magic_functions for examples of actual implementation classes.

Aliases

  • IPython.core.magic.Magics

Referenced by