[IPython-dev] line magic in middle of line

Thomas Kluyver takowl at gmail.com
Wed Dec 24 17:28:09 EST 2014


Hi Kyle,

On 24 December 2014 at 21:52, Kyle Rawlins <rawlins at gmail.com> wrote:

> Is this documented anywhere / actually supported behavior?  Under what
> conditions can line magics be mixed with python code?


It only works in simple assignments, and you can do it with both magics and
!system escapes - the normal demo of that feature is to do "files = !ls".
The timeit magic also returns a useful results object.

It is documented for system commands:
http://ipython.org/ipython-doc/dev/interactive/tutorial.html#system-shell-commands
http://ipython.org/ipython-doc/dev/interactive/reference.html#manual-capture-of-command-output

But I can't currently see anywhere where this is documented for magic
functions.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141224/00240b92/attachment.html>


More information about the IPython-dev mailing list