[IPython-user] ipython + visual
Fernando Perez
Fernando.Perez at colorado.edu
Sun Mar 12 01:41:09 CST 2006
John Hunter wrote:
>>>>>>"sunqiang" == sunqiang <sunqiang at gmail.com> writes:
>
>
> sunqiang> forgive me for out of topic, but when i send the post
> sunqiang> before, it doesn't appear in the maillist. and is it has
> sunqiang> some relationship ?* ipython quits after run a wxpython
> sunqiang> script two times * the script is very simple.
> sunqiang> ================== import wx app = wx.PySimpleApp() win
> sunqiang> = wx.Frame(None, title='Hello World!') win.Show()
> sunqiang> app.MainLoop()* * ================== i start ipython
> sunqiang> with -wthread and run the script times, when i close the
> sunqiang> wxapp the second time, ipython quits.
>
>
> I think you should not be calling MainLoop with -wthread.
Well, I thought that we were doing all the necessary tricks to make sure that
'normal' wx scripts would work OK under -wthread, without needing any
modifications.
In fact, I tried the example and it runs fine for me, regardless of how many
times I close/reopen it.
Note, however, that I had to modify the code a little:
import wx
app = wx.PySimpleApp()
win = wx.Frame(None,-1, title='Hello World!')
win.Show()
app.MainLoop()
Note the extra -1 in the Frame() call. With that change, I can close the
window as many times as I want without any problems, and I tested this both
under Fedora3/WX 2.4 and ubuntu/WX 2.6.
Cheers,
f
More information about the IPython-user
mailing list