Threaded progress bar for python functions