sys.stdout.flush()
time.sleep(0.1)
sys.stdout.write('\rDone!     ')
t = threading.Thread(target=animate)
t.start()
time.sleep(10)
done = True
Python how to make simple animated loading while process is running