thagrol wrote: ↑
Thu Jun 06, 2019 2:14 pm
More complex answer: Use threads. One while loop per thread.
Hit the python docs and your preferred search engine for more info on threads in python.
Slightly more complex answer, still: use multiprocessing. The problem with threads in Python is that a single process can only have one thread active at a time. If you have multiple threads that need to wait for external events (including sleep()), threading will usually work. If you have one or more 'tight' while True loops (not usually a good idea, for many reasons), threading will probably not work well for you.