Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > flow control / get next / filter?

Reply
Thread Tools

flow control / get next / filter?

 
 
Ken Godee
Guest
Posts: n/a
 
      10-29-2003
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading of file by next of map file and by next of file descriptor. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki C++ 1 07-10-2007 02:46 AM
Query:difference between node flow and filter flow in java's I/O,system? Jack Dowson Java 0 05-07-2007 03:35 PM
Next (the other next) Gen "DVD" storage Alan Browne Digital Photography 13 05-31-2005 05:53 PM
CurrentElement->next = CurrentElement->next->next (UNDEFINED?) Deniz Bahar C Programming 2 03-09-2005 12:45 AM
Skipping content in Array within loop and go to the next (of NEXT function) Tad McClellan Perl Misc 3 05-13-2004 10:14 PM



Advertisments