harryos wrote

Here is a technique that allows the loop to run in the background, in its
own thread, leaving the main program to do other processing -

import threading

class DataGetter(threading.Thread):


thanks Frank

A pleasure.

I left out a line that will usually be desirable.

At the end of the program, you should have -

   data_getter.stop()
+   data_getter.join()

This forces the main program to wait until the thread has terminated before continuing.

Frank


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to