469,903 Members | 1,579 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

nanothreads: Want to use them from within wxPython app

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
Nov 22 '05 #1
2 1204
F. GEIGER wrote:
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.

Dec 12 '05 #2

<si**********@gmail.com> schrieb im Newsbeitrag
news:11*********************@z14g2000cwz.googlegro ups.com...
F. GEIGER wrote:
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


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
Dec 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

25 posts views Thread by Daniel Jonsson | last post: by
1 post views Thread by Steven W. Orr | last post: by
1 post views Thread by rocksportrocker | last post: by
1 post views Thread by Farsheed Ashouri | last post: by
16 posts views Thread by Andrea Gavana | last post: by
4 posts views Thread by leon.domingo | last post: by
reply views Thread by Stef Mientki | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.