for i in range(10): sys.stdout.write(".") sys.stdout.flush() time.sleep(1) sys.stdout.write("\n") shutil.copytree("pack", "/lxc/pack") But Here, the loop will first print the progress dots and then it will copy the directory. But I want that these two tasks should run simultaneously.