How to let a loop run for a while before checking for break condition?

S

Sorin Schwimmer

to Fredrik Lundh
I'm afraid Claudio Grondi can't use your solution, as
he needs it hosted on Windows, which lacks
signal.alarm.

to Claudio Grondi
How about splitting your loop in two? The first loop
would check for your boolean, which is changed by your
timer, the second loop will check for your "normal"
exit condition?

Sorin

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 
C

Claudio Grondi

Sorin said:
to Fredrik Lundh
I'm afraid Claudio Grondi can't use your solution, as
he needs it hosted on Windows, which lacks
signal.alarm.

to Claudio Grondi
How about splitting your loop in two? The first loop
would check for your boolean, which is changed by your
timer, the second loop will check for your "normal"
exit condition?
I don't understand your proposal. Do you mean using another thread?
I suppose, that wxPython provides something like what I am looking for,
but using it only to speed up a Python loop is sure not an option.
Concluding from lack of responses related to a Windows version of
Fredriks solution I suppose, that there is no way to achieve it with
standard Python on Windows.

Claudio Grondi
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top