##// END OF EJS Templates
Test of simpler way to define ast macros. (#14100)...
Test of simpler way to define ast macros. (#14100) Provide and easier way to generate magics and pre-post hooks This introduce a code base way of modifying the ast. This allow to use Template strings with the two special variable names names `__code__` and `__ret__` allowing to quickly write a magic, or hooks that modify the ast. This also introduce a `%code_wrap` cell magic to on the fly wrap code. It is this easy to for example modify IPython to say time each block of code, or retry them, or wrap them in try/except and analyse the error message, profile... Note that this is not new, but simply convenience function and utilities, especially around hygiene.

File last commit:

r25387:50afc884
r28324:c3d7f161 merge
Show More
magics.rst
23 lines | 939 B | text/x-rst | RstLexer

Built-in magic commands

Note

To Jupyter users: Magics are specific to and provided by the IPython kernel. Whether Magics are available on a kernel is a decision that is made by the kernel developer on a per-kernel basis. To work properly, Magics must use a syntax element which is not valid in the underlying language. For example, the IPython kernel uses the % syntax element for Magics as % is not a valid unary operator in Python. However, % might have meaning in other languages.

Here is the help auto-generated from the docstrings of all the available Magics functions that IPython ships with.

You can create and register your own Magics with IPython. You can find many user defined Magics on PyPI. Feel free to publish your own and use the Framework :: IPython trove classifier.