Ahmed has shown how to view the dots as they are printed, but has not addressed the 'parallel' aspect.
Here is one approach, which uses the threading module to print the dots in a separate thread while the main thread does the copying.
import sys
import threading
class ProgressBar(threading.Thread):
"""
In a separate thread, print dots to the screen until terminated.
"""
def __init__(self):
threading.Thread.__init__(self)
self.event = threading.Event()
def run(self):
event = self.event # make local
while not event.is_set():
sys.stdout.write(".")
sys.stdout.flush()
event.wait(1) # pause for 1 second
sys.stdout.write("n")
def stop(self):
self.event.set()
Before starting the copy -
progress_bar = ProgressBar()
progress_bar.start()
When the copy is finished -
progress_bar.stop()
progress_bar.join()