I’ve got a question about my old nemisis, the invokeAsynchronous call. Here’s what I’m trying to do: I have another function that is listening for incoming messages, and it adds the raw data to a dictionary. In this new function, I just want it to sit there spinning and check to see if there are new values in the dictionary, do something with it, and then delete the new value. Right now I’m doing it with a timer, but it really isn’t the right way.
Here’s my pseudo code:
def doAsynch(): def copyData(): global myDictionary while 1: k = myDictionary.keys() k.sort() for i in k:: #Do a bunch of stuff here del myDictionary[i] copyData() system.util.invokeAsynchronous(doAsynch)
I do something very similar in my socket function, and it works fine, but this code locks up the GUI in the ‘while’ loop. Btw, this code is in the button press event.
Ideas on how to accomplish this? Thanks!