January 2018
Beginner to intermediate
548 pages
12h 11m
English
Although IPython comes with a wide variety of magic commands, there are cases where we need to implement custom functionality in new magic commands. In this recipe, we will show how to create line and magic cells, and how to integrate them in an IPython extension.
>>> from IPython.core.magic import (register_line_magic,
register_cell_magic)%-prefixed name). The name of this function is the name of the magic. Then, we decorate this function with @register_line_magic:>>> @register_line_magic ...
Read now
Unlock full access