Mar-04-2018, 07:41 PM
(Mar-03-2018, 09:33 PM)marsokod Wrote: You may want to use a thread or a process depending on what your function1 and function2 are doing. You can either start them manually, use a library like APScheduler to have a pool of threads/process and add your function to the job queue, or start thread/processes at the beginning of your code and have them read elements in a queue. In the last case, your ReadSerial function would only have to put an element in a queue, which should minimize any interruption to the monitoring.
Whoud the class threading.Event be helpful?
https://docs.python.org/3.5/library/thre...Event.wait