From: John H. <jdh...@ac...> - 2004-09-07 20:50:34
|
I got an answer from Robin Dunn on the wxpython list about the stderr/stdout bug that was breaking ipython -pylab with the wx* matplotlib backends. It turns out that the defaults for output redirection are different on the different platforms, which explains why it worked on linux but not win32 or OSX. All you need to do is pass redirect=False to the wxapp constructor. Eg, on or around line in 498 IPython/Shell.py v0.6.3 self.app = App(redirect=False) Confirmed to fix both OSX and win32 for wx*. Now I think the summary is linux win32 OSX GTK* : good ugly works except for shell close bug WX* : good good good TK* : good good good Cool. If only all bugs were so easy. JDH |
From: Fernando P. <Fer...@co...> - 2004-09-08 23:41:27
|
John Hunter wrote: > I got an answer from Robin Dunn on the wxpython list about the > stderr/stdout bug that was breaking ipython -pylab with the wx* > matplotlib backends. It turns out that the defaults for output > redirection are different on the different platforms, which explains > why it worked on linux but not win32 or OSX. > > All you need to do is pass redirect=False to the wxapp constructor. > Eg, on or around line in 498 IPython/Shell.py v0.6.3 > > self.app = App(redirect=False) > > Confirmed to fix both OSX and win32 for wx*. Great! Many thanks. I've just committed the fix into CVS. > Now I think the summary is > > linux win32 OSX > GTK* : good ugly works except for shell close bug > WX* : good good good > TK* : good good good Do you think we'll be able to get the GTK/win32 setup working? You probably know that platform better than anybody else here, so I'm pretty useless on this one. But it would be great to be able to make a final ipython release before I get into the 'big cleanup', so that matplotlib users on all platforms/backends can use pylab happily while I work on the cleanup. Best, f ps. You have for me: Fernando Perez <fp...@pi...>. You should switch to Fer...@co..., which should be a more stable address for the long term (pizero was a local Physics server, and that account may disappear in the future). |
From: John H. <jdh...@ac...> - 2004-09-09 13:31:34
|
>>>>> "Fernando" == Fernando Perez <Fer...@co...> writes: Fernando> Do you think we'll be able to get the GTK/win32 setup Fernando> working? You probably know that platform better than Fernando> anybody else here, so I'm pretty useless on this one. Fernando> But it would be great to be able to make a final ipython Fernando> release before I get into the 'big cleanup', so that Fernando> matplotlib users on all platforms/backends can use pylab Fernando> happily while I work on the cleanup. Gee, some people are never satisfied! I was able to replicate the gtk win32 problem in the matplotlib interactive.py, which as you know is based on Brian McErlean and John Finlay's ASPN cookbook recipe. However, the original recipe does not have this bug. By diffing them, I traced the problem to the call to gtk.threads_init(). This call is required on linux and OSX, but breaks win32. Typical. So it's a hack but at least it works in my tests thus far. In IPython/Shell.py on or around line 424, replace the mainloop function with def mainloop(self): self.gtk.timeout_add(self.TIMEOUT, self.IP.runcode) if sys.platform != 'win32': try: if self.gtk.gtk_version[0] >= 2: self.gtk.threads_init() except AttributeError: pass self.start() self.gtk.mainloop() self.join() Incidentally, this or some other change appears to fix the GTK OSX confirm on exit bug (the only other change here is that I call 'start' after the threads_init call). Thus I can happily report that with this change and the one you included in CVS yesterday for output redirection in wx, all the backends seem to be working across all the major platforms in ipython. And there was much rejoicing. JDH |
From: Alan G I. <ai...@am...> - 2004-09-09 14:19:25
|
On Thu, 09 Sep 2004, John Hunter apparently wrote: > And there was much rejoicing. Actually, yes! Alan Isaac |
From: Fernando P. <Fer...@co...> - 2004-09-09 19:23:17
|
John Hunter wrote: >>>>>>"Fernando" == Fernando Perez <Fer...@co...> writes: > Gee, some people are never satisfied! You should know me by now :) > In IPython/Shell.py on or around line 424, replace the mainloop > function with [...] Great, I just put it in CVS. Many thanks! > Incidentally, this or some other change appears to fix the GTK OSX > confirm on exit bug (the only other change here is that I call 'start' > after the threads_init call). > > Thus I can happily report that with this change and the one you > included in CVS yesterday for output redirection in wx, all the > backends seem to be working across all the major platforms in ipython. > > And there was much rejoicing. Indeed! So it seems like the little matrix you sent yesterday now reads: linux win32 OSX GTK* : good good good WX* : good good good TK* : good good good :) I think I'm actually going to make a 0.6.4 release with these fixes, since making this functionality useful across the board is worth it IMO. After the warm reception the ipython+matplotlib combo got at scipy, it would be nice to give users something that really works across all platforms. Again, many thanks for this: you know if it were up to me the win32 bug would have lingered forever. Best, f |