nanothreads: Want to use them from within wxPython app

F

F. GEIGER

I've def'ed a handler for EVT_IDLE in the app's main frame. There I'd like
to call the nanothreads' __iter__ method, somehow.

When I copy the __iter__ method into a, say, runOnce() method and call the
next() method of the generator returned by runOnce(), it works. But I can't
get at the __iter__ method, which is already there and therefore should be
used instead of messing up nanothreads with changes of mine.

Any hint welcome

Kind regards
Franz GEIGER
 
S

simonwittber

F. GEIGER said:
I've def'ed a handler for EVT_IDLE in the app's main frame. There I'd like
to call the nanothreads' __iter__ method, somehow.

When I copy the __iter__ method into a, say, runOnce() method and call the
next() method of the generator returned by runOnce(), it works. But I can't
get at the __iter__ method, which is already there and therefore should be
used instead of messing up nanothreads with changes of mine.

Any hint welcome

The latest version of nanothreads is now in the fibranet package, which
you can download from the cheeseshop:

http://cheeseshop.python.org/pypi/FibraNet

To iterate nanothreads from wx, I call the nanothreads.poll() function
from the EVT_IDLE handler, making sure that I call event.RequestMore()
from within the handler, to iterate nanothreads as fast as possible.

HTH, Simon WIttber.
 
F

F. GEIGER

The latest version of nanothreads is now in the fibranet package, which
you can download from the cheeseshop:

http://cheeseshop.python.org/pypi/FibraNet

To iterate nanothreads from wx, I call the nanothreads.poll() function

Yeah, that's what I was looking for. But poll() is new, isn't it?

from the EVT_IDLE handler, making sure that I call event.RequestMore()

Good hint, thanks, I always tend to forget that.

from within the handler, to iterate nanothreads as fast as possible.

HTH, Simon WIttber.

Thanks for your response and kind regards
Franz GEIGER
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top