Python thread module to repeat an predefined task on a thread mulitple times