def download_progress_hook(count, blockSize, totalSize):
    'A hook to report the progress of a download. This is mostly intended for users with\n    slow internet connections. Reports every 5% change in download progress.\n    '
    global last_percent_reported
    percent = int((((count * blockSize) * 100) / totalSize))
    if (last_percent_reported != percent):
        if ((percent % 5) == 0):
            sys.stdout.write(('%s%%' % percent))
            sys.stdout.flush()
        else:
            sys.stdout.write('.')
            sys.stdout.flush()
        last_percent_reported = percent
A hook to report the progress of a download. This is mostly intended for users with
slow internet connections. Reports every 5% change in download progress.
def download_progress_hook(count, blockSize, totalSize):
    'A hook to report the progress of a download. This is mostly intended for users with\n    slow internet connections. Reports every 5% change in download progress.\n    '
    global last_percent_reported
    percent = int((((count * blockSize) * 100) / totalSize))
    if (last_percent_reported != percent):
        if ((percent % 5) == 0):
            sys.stdout.write(('%s%%' % percent))
            sys.stdout.flush()
        else:
            sys.stdout.write('.')
            sys.stdout.flush()
        last_percent_reported = percent