def main(test=False): showTime() LogManager.Init() p_list = list() p1 = Process(target=ProxyApiRun, name='ProxyApiRun') p_list.append(p1) p2 = Process(target=ValidRun, name='ValidRun') p_list.append(p2) p3 = Process(target=RefreshRun, name='RefreshRun') p_list.append(p3) for p in p_list: p.daemon = True p.start() if test: time.sleep(5) sys.exit(0) else: for p in p_list: p.join()