Dan,

This question probably belongs on the ipython list.  I've cc'd this there.

http://mail.scipy.org/mailman/listinfo/ipython-dev

On Tue, Mar 17, 2009 at 8:55 PM, Dan Drake <dr...@kaist.edu> wrote:
> Hello,
>
> I'm interested in doing a bunch of timing, so I'd like to put %time or
> %timeit statements inside a loop. But there's a problem: if I type out
> something like
>
>  sage: for n in [1..5]:
>  ....:     print 'n is %d' % n
>  ....:     %time N(pi**n)
>  ....:
>
> I get the expected output, but if I want to change something -- say, pi
> to sqrt(2), if I hit the up arrow twice and edit the lines, I get this:
>
>  sage: for n in [1..5]:
>      print 'n is %d' % n
>      %time N(sqrt(2)**n)
>  ------------------------------------------------------------
>     File "<ipython console>", line 3
>       %time N(sqrt(2)**n)
>       ^
>  SyntaxError: invalid syntax
>
> I know the % functions are special IPython things, but why do they work
> when I type things in manually, but not when I hit the arrows to go
> back?
>
> Dan
>
> --
> ---  Dan Drake <dr...@kaist.edu>
> -----  KAIST Department of Mathematical Sciences
> -------  http://mathsci.kaist.ac.kr/~drake
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAknAcJgACgkQr4V8SljC5LqonQCg1VBr6J5Cx4idxz7zTlz+HzpX
> fycAoLLzm4KhO4Fxe+2JSUnBoxBR/BMc
> =jqhV
> -----END PGP SIGNATURE-----
>
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to