title: Python how to make simple animated loading while process is running
body: <p>This is pretty much what I have right now:</p>
  
  <pre><code>import time
  import sys
  
  done = 'false'
  #here is the animation
  def animate():
      while done == 'false':
          sys.stdout.write('\rloading |')
          time.sleep(0.1)
          sys.stdout.write('\rloading /')
          time.sleep(0.1)
          sys.stdout.write('\rloading -')
          time.sleep(0.1)
          sys.stdout.write('\rloading \\')
          time.sleep(0.1)
      sys.stdout.write('\rDone!     ')
  
  animate()
  #long process here
  done = 'false'
  </code></pre>
  
  <p>and I want to get it so that the "while" script would function independently, and it continues to the process, while the animation is going on until the end of the process signals the variable "done" to be 'false', stopping the animation and replacing it with "Done!". This method would be essentially running two scripts at once; is there a way to do it?</p>