code: def progress_bar(iteration,
                   total,
                   prefix=None,
                   suffix=None,
                   decs=1,
                   length=100):
      
      if prefix is None:
          prefix = ''
  
      if suffix is None:
          suffix = ''
  
      format_str = '{0:.' + str(decs) + 'f}'
      percents = format_str.format(100 * (iteration / float(total)))
      filled_length = int(round(length * iteration / float(total)))
      bar = '█' * filled_length + '-' * (length - filled_length)
  
      prefix, suffix = prefix.strip(), suffix.strip()
  
      sys.stdout.write('\r%s |%s| %s%s %s' % (prefix, bar, percents, '%', suffix))
      sys.stdout.flush()
  
      if iteration == total:
          sys.stdout.write('\n')
          sys.stdout.flush()
  
      return None
docs: Creates a console progress bar.
  
      This should be called in a loop to create a progress bar.
  
      See `StackOverflow <http://stackoverflow.com/questions/3173320/>`__.
  
      Args:
        iteration (int): current iteration
        total (int): total iterations
        prefix (str): prefix string
        suffix (str): suffix string
        decs (int): positive number of decimals in percent complete
        length (int): character length of the bar
  
      Returns:
        ``None``
  
      Note:
        This function assumes that nothing else is printed to the console in the
        interim.