[IPython-User] iPython notebook and statements that span multiple lines

Thomas Kluyver takowl@gmail....
Mon Nov 12 04:54:46 CST 2012


Hi Will,

On 12 November 2012 10:48, William Furnass <will@thearete.co.uk> wrote:

> %timeit x = [1,
>
>              2,
>
>              3]
>
> IndentationError: unexpected indent
>
>
> Is this a bug or am I missing something obvious here?
>
>
I guess it's not exactly obvious, but you can't (yet) split a line magic
over several lines. You'll need to use a cell magic, like this:

%%timeit
x = [1,
     2,
     3]

Hope that helps,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121112/b7743a46/attachment.html 


More information about the IPython-User mailing list