473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1329
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: F. GEIGER | last post by:
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...
25
by: Daniel Jonsson | last post by:
So, I've reached the point where my building pipeline tools actually needs to be used by other people in my company. By this reason I actually need to think about the usability, and I've come to...
1
by: Steven W. Orr | last post by:
python-2.3.5 wx-2.6 I just bought the wxPython In Action book and I see that all the examples say to import wx All of our pre-existing code was horribly doing a from wxPython import * I...
1
by: rocksportrocker | last post by:
Hi, I want to visualize some vtk-files within a wxPython Window. Google did not help me very much, I only found some tools for Tk, what is no solution for me. I'm sure I am not the first one...
1
by: Farsheed Ashouri | last post by:
Hi everyone. I create a little browser with wxpython and IEHtmlWindow. But I have a little problem here. When I press enter in the html page, The focus goes to another panel. Why this happens? I...
16
by: Andrea Gavana | last post by:
Hi Diez & All, Do you mind explaining "why" you find it *buttugly*? I am asking just out of curiosity, obviously. I am so biased towards wxPython that I won't make any comment on this thread...
3
by: mistersulu | last post by:
Hi all: I'm using a wx.ListView object with a multi-threaded wxPython app. The list is dynamically generated and accessed across two or more threads. In spite of the fact that I have checks to...
4
by: leon.domingo | last post by:
Hello, I've installed Eclipse, Python 2.5 and wxPython on Ubuntu 8.04. The problem is that I can't get code completion for wx module. I don't know if it occurs the same with other libraries...
0
by: Stef Mientki | last post by:
Peter Anderson wrote: In PyScripter, you should run wxPython in the plain remote machine (not the wxPython remote), and you should set "reset before run flag" or reset the remote machine each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.