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_magicand@cell_magicto decorate individual methods as magic functions, ANDUse the class decorator
@magics_classto 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