[IPython-User] IPython qtconsole does not like statements separated by a semicolon

Paul Hobson pmhobson@gmail....
Wed Nov 7 17:58:34 CST 2012


On Wed, Nov 7, 2012 at 3:36 PM, Alejandro Weinstein
<alejandro.weinstein@gmail.com> wrote:
> Hi:
>
> In IPython I can do the following:
>
> In [1]: a = range(10); print len(a)
> 10
>
> However, doing the same in the qtconsole I get
>
> In [1]: a = range(a); print len(a)
>
>    ...:
>
> ---------------------------------------------------------------------------
>
> NameError Traceback (most recent call last)
>
> <ipython-input-1-8df4a6013a5f> in <module>()
>
> ----> 1 a = range(a); print len(a)
>
> 2

Your two commands are different. In the qtconsole version, you call
range(a) instead of range(10).

In qtconsole:

In [1]: a = range(10); print(len(a))
   ...:
10
In [2]:

works fine for me.


More information about the IPython-User mailing list