[Twisted-Python] Twisted and wxPython on windows

Hi all, I'm currently testing my python/twisted/wxWindows application under Win98 (development is done under Linux). Has anyone tested this before? The application is rather unresponsive sometimes, even with the win32evenreactor installed. Does anyone know if things will perform better under win2k? I avoid touching Windows as much as possible, so I'm somewhat of a newbie in this area (windows development and python under windows). Cheers Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase W http://www.amaze.nl E info@amaze.nl Network Solutions W http://vanderwijk.info E ivo@amaze.nl Consultancy PGP http://vanderwijk.info/pgp -=-

Ivo van der Wijk <ivo@amaze.nl> writes:
You might want to try (if you're brave) the win32guireactor I posted here some time ago (although it's really not finished). IMO the problem is that the current win32 reactor isn't really event driven, it does polling behind the scenes. Thomas

On Tuesday 11 March 2003 06:27 am, Ivo van der Wijk wrote:
The basic problem with wxPython and Twisted is the wxpython internal event loop. If you follow the demos and docs of Twisted (using wxsupport) your app will freeze whenever you open a menu or a modal dialogbox. This is due to the fact that wxWindows uses a different eventloop to handle this type of events. The wx main eventloop will suspend until the menu etc. closes. Using wxsupport this will also freeze the twisted eventloop. Ergo - nothing works until you close whatever popped up. I posted a recipe in the Python Cookbook (activestate.com) a while ago. Basically I solved the problem by running the normal wx eventloop and using timers to run the twisted events. just check it out. It's only tested on linux but maybe it helps you. UC -- Open Source Solutions 4U, LLC 2570 Fleetwood Drive Phone: +1 650 872 2425 San Bruno, CA 94066 Cell: +1 650 302 2405 United States Fax: +1 650 872 2417

In documentation : "WxPython As with Tkinter, the support for integrating Twisted with a WxPython application uses specialized support code rather than a simple reactor. from wxPython.wx import * from twisted.internet import wxsupport, reactor myWxAppInstance = MyWxApp(0) wxsupport.install(myWxAppInstance) reactor.run()" And I have seen a wxsupport(app) in the API documentation, but can't find it again. Uwe C. Schroeder wrote:

On Wed, Mar 12, 2003 at 08:59:46AM +0100, Philippe Lafoucrière wrote:
This is not the issue. The problem is the reactor that seems 'sluggish' under windows, making the app freeze quite often. It seems that win2k does alot better, so perhaps that should be the target platform. I'll give the guieventreactor a try tough. Cheers Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase W http://www.amaze.nl E info@amaze.nl Network Solutions W http://vanderwijk.info E ivo@amaze.nl Consultancy PGP http://vanderwijk.info/pgp -=-

Thomas, could you please send me a link to your win32guireactor / posting? I'm not able to find anything google. Also, I'm not really impressed by the basic Twisted support for wxPython - it basically does a polling loop. Are better solutions impossible? Cheers Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase W http://www.amaze.nl E info@amaze.nl Network Solutions W http://vanderwijk.info E ivo@amaze.nl Consultancy PGP http://vanderwijk.info/pgp -=-

[posted and mailed] Ivo van der Wijk <ivo@amaze.nl> writes:
Thomas, could you please send me a link to your win32guireactor / posting? I'm not able to find anything google.
http://twistedmatrix.com/pipermail/twisted-python/2003-February/002911.html
Also, I'm not really impressed by the basic Twisted support for wxPython - it basically does a polling loop. Are better solutions impossible?
IMO the twisted wxreactor (or what it's called) does it wrong (Note that I'm only talking about Windows here, I have no clue about Linux or other systems): it tries to integrate the wxPython eventloop into twisted's event loop, while it should be exactly reverse: the twisted 'events' must be passed through wxPython's event loop, which is a Windows messageloop. See also the description in the post mentioned above. And it *should* also work unchanged with other GUI toolkits, Tkinter for example, although I didn't try this. But win32guireactor is incomplete and not finished, read the source to find out more. Thomas

On Fri, Mar 14, 2003 at 04:03:46PM +0100, Thomas Heller wrote:
I agree - this is how the other reactors (gtk, qt) work as well. I assume wxWindows doesn't have enough 'hooks' by default to create a reactor for it?
Well, I'm completely unfamiliar with the win32 api. Could you give any hints on what functionality is lacking? Cheers Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase W http://www.amaze.nl E info@amaze.nl Network Solutions W http://vanderwijk.info E ivo@amaze.nl Consultancy PGP http://vanderwijk.info/pgp -=-

Ivo van der Wijk <ivo@amaze.nl> writes:
You might want to try (if you're brave) the win32guireactor I posted here some time ago (although it's really not finished). IMO the problem is that the current win32 reactor isn't really event driven, it does polling behind the scenes. Thomas

On Tuesday 11 March 2003 06:27 am, Ivo van der Wijk wrote:
The basic problem with wxPython and Twisted is the wxpython internal event loop. If you follow the demos and docs of Twisted (using wxsupport) your app will freeze whenever you open a menu or a modal dialogbox. This is due to the fact that wxWindows uses a different eventloop to handle this type of events. The wx main eventloop will suspend until the menu etc. closes. Using wxsupport this will also freeze the twisted eventloop. Ergo - nothing works until you close whatever popped up. I posted a recipe in the Python Cookbook (activestate.com) a while ago. Basically I solved the problem by running the normal wx eventloop and using timers to run the twisted events. just check it out. It's only tested on linux but maybe it helps you. UC -- Open Source Solutions 4U, LLC 2570 Fleetwood Drive Phone: +1 650 872 2425 San Bruno, CA 94066 Cell: +1 650 302 2405 United States Fax: +1 650 872 2417

In documentation : "WxPython As with Tkinter, the support for integrating Twisted with a WxPython application uses specialized support code rather than a simple reactor. from wxPython.wx import * from twisted.internet import wxsupport, reactor myWxAppInstance = MyWxApp(0) wxsupport.install(myWxAppInstance) reactor.run()" And I have seen a wxsupport(app) in the API documentation, but can't find it again. Uwe C. Schroeder wrote:

On Wed, Mar 12, 2003 at 08:59:46AM +0100, Philippe Lafoucrière wrote:
This is not the issue. The problem is the reactor that seems 'sluggish' under windows, making the app freeze quite often. It seems that win2k does alot better, so perhaps that should be the target platform. I'll give the guieventreactor a try tough. Cheers Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase W http://www.amaze.nl E info@amaze.nl Network Solutions W http://vanderwijk.info E ivo@amaze.nl Consultancy PGP http://vanderwijk.info/pgp -=-

Thomas, could you please send me a link to your win32guireactor / posting? I'm not able to find anything google. Also, I'm not really impressed by the basic Twisted support for wxPython - it basically does a polling loop. Are better solutions impossible? Cheers Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase W http://www.amaze.nl E info@amaze.nl Network Solutions W http://vanderwijk.info E ivo@amaze.nl Consultancy PGP http://vanderwijk.info/pgp -=-

[posted and mailed] Ivo van der Wijk <ivo@amaze.nl> writes:
Thomas, could you please send me a link to your win32guireactor / posting? I'm not able to find anything google.
http://twistedmatrix.com/pipermail/twisted-python/2003-February/002911.html
Also, I'm not really impressed by the basic Twisted support for wxPython - it basically does a polling loop. Are better solutions impossible?
IMO the twisted wxreactor (or what it's called) does it wrong (Note that I'm only talking about Windows here, I have no clue about Linux or other systems): it tries to integrate the wxPython eventloop into twisted's event loop, while it should be exactly reverse: the twisted 'events' must be passed through wxPython's event loop, which is a Windows messageloop. See also the description in the post mentioned above. And it *should* also work unchanged with other GUI toolkits, Tkinter for example, although I didn't try this. But win32guireactor is incomplete and not finished, read the source to find out more. Thomas

On Fri, Mar 14, 2003 at 04:03:46PM +0100, Thomas Heller wrote:
I agree - this is how the other reactors (gtk, qt) work as well. I assume wxWindows doesn't have enough 'hooks' by default to create a reactor for it?
Well, I'm completely unfamiliar with the win32 api. Could you give any hints on what functionality is lacking? Cheers Ivo -- Drs. I.R. van der Wijk -=- Brouwersgracht 132 Amaze Internet Services V.O.F. 1013 HA Amsterdam, NL -=- T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase W http://www.amaze.nl E info@amaze.nl Network Solutions W http://vanderwijk.info E ivo@amaze.nl Consultancy PGP http://vanderwijk.info/pgp -=-
participants (5)
-
Itamar Shtull-Trauring
-
Ivo van der Wijk
-
Philippe Lafoucrière
-
Thomas Heller
-
Uwe C. Schroeder