[IPython-dev] execute() in IPython widgets

Steve Jackson steve.jackson at icecube.wisc.edu
Wed May 15 12:25:14 EDT 2013


My last message is somewhat incorrect, and the example bug it contains is more complex than I wrote.  Here is a thing that fails in strange ways:

widget.execute("print 'Message one'")
widget.input_buffer = "print 'Second line'"
widget.execute()

When I run this sequence I see this output:

In [2]: print 'Message one'
Message one

Message one

In [1]: print 'Second line'

Note that the first print message repeats twice, while the second is never printed.  Perhaps this is a bug in execute(), or perhaps I am trying to do something unsupported.

Sorry for the confusion in my earlier message.
~S

> These approaches don't help me (I don't seem to have a %%load function, though I do have %load).  But this have helped me isolate the problem with print messages.  If I execute the following lines:
> 
> widget.input_buffer = "print 'Hello'"
> widget.execute( interactive=True )
> 
> then the following output appears in the widget:
> 
> In [1]: print 'Hello'
> 
> However, the actual print statement is not echoed in the widget, as it would have if the command had been executed in response to user keyboard input.
> ~S
> 
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev




More information about the IPython-dev mailing list