473,387 Members | 1,891 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.

flow control / get next / filter?

I'm trying to figure out how to get the value of a variable
that's constantly getting updated, but only get the new
value, once it has changed.

I have a module where I register a call back to a function
in the code I'm working on. This function gets updated continuely.
ie....

x = ''
def myfunc(event)
global x
x = event

if you where to do a while loop, you would end up with something like...

while 1:
print x
if x == 'stop':
break

1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,

if you where to do a nested while, you would get....

while 1:
print x
while x != x:
print x
if x == 'stop':
break
if x == 'stop':
break

1,2,3,4,5

but it of coarse just spins the loop and processor loads pegs out.

If someone could point me in a direction, I'd appreciate it.
Thanks

Jul 18 '05 #1
0 1025

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Chan | last post by:
Hi, I'm trying to use python to create GUI wizards, i.e. sequences of dialog boxes with <BACK and NEXT> buttons. Since I want to re-use some of the dialog boxes in different wizards, I want to...
11
by: Robert Bowen | last post by:
Hello all. I have been given mock-ups (in static HTML) of some pages for a site I am working on. The client would like these pages to look exactly as they do now. The problem is that the content is...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
5
by: Miyra | last post by:
Hi. I'm working with an app that uses exceptions for control flow. These are code blocks where exceptions are thrown/caught regularly. A couple hundred exceptions occur per hour and they're caught...
9
by: Alvin Bruney [MVP] | last post by:
Exceptions must not be used to control program flow. I intend to show that this statement is flawed. In some instances, exceptions may be used to control program flow in ways that can lead to...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
10
by: Dennis D. | last post by:
Hello: There are a series of textboxes (x.text, y.text, z.text etc.) in which user input is expected. As: dtmX=CDate(x.text) dtmY=CDate(y.text) dtmZ=CDate(z.text) where x, y, and z.text...
15
by: c676228 | last post by:
Hi all, In traditional asp form, there is an action field in a form, any time the page is valid, after click the submit button, the next page comes up based on the value in the action field. In...
7
by: Buck Rogers | last post by:
Hi all! Newbie here. Below is an example from Teach Yourself C in 21 Days. My apologies if it is a bit long. What I don't understand is how the "get_data" function can call the...
2
by: colin | last post by:
Hi, Im tidying up some code ive written wich atm is all in the main form. its working reasonably well, uses zedgraph wich is nice, but i need to tidy it up as its become increasingly difficult...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.