[Stackless] stackless & wxpython in one app?

Andrew Francis andrewfr_ice at yahoo.com
Tue Jan 6 16:55:02 CET 2009


Hi Paul:

I have glanced at but never used wxPython. Like Stackless (or Twisted), wxPython assumes it is the prime mover of your application. I believe wxPython has an Idle event. I suspect the following would work:

1) Put wxPython in its own tasklet.

stackless.tasklet(app.mainLoop)() # kick off the application
stackless.run()                   # stackless scheduler starts

2) Have wxPython OnIdle event callbacks invoke stackless.schedule() to return control to the stackless scheduler.

Cheers,
Andrew


--- On Tue, 1/6/09, stackless-request at stackless.com <stackless-request at stackless.com> wrote:

> From: stackless-request at stackless.com <stackless-request at stackless.com>
> Subject: Stackless Digest, Vol 60, Issue 4
> To: stackless at stackless.com
> Date: Tuesday, January 6, 2009, 3:00 AM
> Send Stackless mailing list submissions to
> 	stackless at stackless.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://www.stackless.com/mailman/listinfo/stackless
> or, via email, send a message with subject or body
> 'help' to
> 	stackless-request at stackless.com
> 
> You can reach the person managing the list at
> 	stackless-owner at stackless.com
> 
> When replying, please edit your Subject line so it is more
> specific
> than "Re: Contents of Stackless digest..."
> 
> 
> Today's Topics:
> 
>    1. stackless & wxpython in one app? (Paul Sijben)
>    2. Re: stackless & wxpython in one app? (Richard
> Tew)
>    3. Re: stackless & wxpython in one app? (Paul
> Sijben)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 05 Jan 2009 14:35:21 +0100
> From: Paul Sijben <sijben at eemvalley.com>
> Subject: [Stackless] stackless & wxpython in one app?
> To: stackless at stackless.com
> Message-ID: <49620C99.6040603 at eemvalley.com>
> Content-Type: text/plain; charset=UTF-8
> 
> Until now I have been using stackless on my server and
> wxpython on the
> client of my application.
> 
> However I have the feeling the client would be much more
> nippy if it
> used stackless too.
> 
> Is there a way for both wxpython and stackless to work in
> one application?
> 
> Paul
> 
> -- 
> Paul Sijben                    	tel: +31334566488
> Eemvalley Technology BV       	fax: +31334557523
> the Netherlands                	http://eemvalley.com    
> -----------------------------------------------------
> EemValley Technology werft python & wxpython 
> programmeurs: http://www.eemvalley.nl/jobs
> 
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Mon, 5 Jan 2009 12:32:22 -0500
> From: "Richard Tew"
> <richard.m.tew at gmail.com>
> Subject: Re: [Stackless] stackless & wxpython in one
> app?
> To: "Paul Sijben" <sijben at eemvalley.com>
> Cc: stackless at stackless.com
> Message-ID:
> 	<952d92df0901050932k3d6dc01eq27625be84d64ac7a at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> On Mon, Jan 5, 2009 at 8:35 AM, Paul Sijben
> <sijben at eemvalley.com> wrote:
> > Until now I have been using stackless on my server and
> wxpython on the
> > client of my application.
> >
> > However I have the feeling the client would be much
> more nippy if it
> > used stackless too.
> >
> > Is there a way for both wxpython and stackless to work
> in one application?
> 
> There is some discussion of this on the list in the past,
> although I
> am not willing to google it and determine if it is
> worthwhile to use
> as a reference on the subject.
> 
> This link alludes that it is very simple:
> http://aigamedev.com/Blog/2006/09/12/automated-testing-of-user-interfaces-in-wxpython/
> 
> "Integration of Stackless with wxPython. This can be
> done very simply;
> the python script launches stackless.run(), and the main
> tasklet runs
> the wxPython event loop."
> 
> Cheers,
> Richard.
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Tue, 06 Jan 2009 08:42:33 +0100
> From: Paul Sijben <sijben at eemvalley.com>
> Subject: Re: [Stackless] stackless & wxpython in one
> app?
> To: Richard Tew <richard.m.tew at gmail.com>
> Cc: stackless at stackless.com
> Message-ID: <49630B69.9040301 at eemvalley.com>
> Content-Type: text/plain; charset="windows-1252"
> 
> I have tried that but found that my stackless threadlets
> are not fired.
> 
> On my server I had ended up putting a while 1: around
> stackless.run() to
> ensure that stackless keeps on running for me.
> This is of course incompatible with starting the wxpython
> main loop.
> 
> Paul
> 
> 
> Richard Tew wrote:
> > On Mon, Jan 5, 2009 at 8:35 AM, Paul Sijben
> <sijben at eemvalley.com> wrote:
> >   
> >> Until now I have been using stackless on my server
> and wxpython on the
> >> client of my application.
> >>
> >> However I have the feeling the client would be
> much more nippy if it
> >> used stackless too.
> >>
> >> Is there a way for both wxpython and stackless to
> work in one application?
> >>     
> >
> > There is some discussion of this on the list in the
> past, although I
> > am not willing to google it and determine if it is
> worthwhile to use
> > as a reference on the subject.
> >
> > This link alludes that it is very simple:
> >
> http://aigamedev.com/Blog/2006/09/12/automated-testing-of-user-interfaces-in-wxpython/
> >
> > "Integration of Stackless with wxPython. This can
> be done very simply;
> > the python script launches stackless.run(), and the
> main tasklet runs
> > the wxPython event loop."
> >
> > Cheers,
> > Richard.
> >   
> 
> -- 
> Paul Sijben                    	tel: +31334566488
> Eemvalley Technology BV       	fax: +31334557523
> the Netherlands                	http://eemvalley.com    
> -----------------------------------------------------
> EemValley Technology werft python & wxpython 
> programmeurs: http://www.eemvalley.nl/jobs
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://www.stackless.com/pipermail/stackless/attachments/20090106/b7c92c58/attachment.html>
> 
> ------------------------------
> 
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
> 
> End of Stackless Digest, Vol 60, Issue 4
> ****************************************



      




More information about the Stackless mailing list