<div dir="ltr"><span style="font-size:13px">>But I can't currently see anywhere where this is documented for magic functions.</span><br><div><span style="font-size:13px"><br></span></div><div>It is poorly "documented" (in fact, shown) in the examples [1] and, IIRC, in the IPython-in-depth tutorial...</div><div><br></div><div>[1] <a href="http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/IPython%20Kernel/Beyond%20Plain%20Python.ipynb">http://nbviewer.ipython.org/github/ipython/ipython/blob/master/examples/IPython%20Kernel/Beyond%20Plain%20Python.ipynb</a></div><div><br></div><div>Cheers</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-24 19:28 GMT-03:00 Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com" target="_blank">takowl@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Hi Kyle,<span class=""><br><br>On 24 December 2014 at 21:52, Kyle Rawlins <span dir="ltr"><<a href="mailto:rawlins@gmail.com" target="_blank">rawlins@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Is this documented anywhere / actually supported behavior?  Under what conditions can line magics be mixed with python code?</blockquote></span></div><br></div><div class="gmail_extra">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.<br><br>It is documented for system commands:<br><a href="http://ipython.org/ipython-doc/dev/interactive/tutorial.html#system-shell-commands" target="_blank">http://ipython.org/ipython-doc/dev/interactive/tutorial.html#system-shell-commands</a><br><a href="http://ipython.org/ipython-doc/dev/interactive/reference.html#manual-capture-of-command-output" target="_blank">http://ipython.org/ipython-doc/dev/interactive/reference.html#manual-capture-of-command-output</a><br><br></div><div class="gmail_extra">But I can't currently see anywhere where this is documented for magic functions.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra">Thomas<br></div></font></span></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><b><i>Damián</i></b></div></div>
</div>