Simple example of multithreading and multiprocessing in Python

Implementing multithreading or multiprocessing in Python is really easy. However when running a function in a thread and collect its return value, needs a trick. There are multiple solutions to do so, here is shown just one way of many possible ways. Choosing between multithreading or…