September 2014
Intermediate to advanced
512 pages
12h 39m
English
Although IPython comes with a wide variety of magic commands, there are cases where we need to implement custom functionality in a new magic command. In this recipe, we will show how to create line and magic cells, and how to integrate them in an IPython extension.
In [1]: 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:In [2]: @register_line_magic ...
Read now
Unlock full access