def processing_flush(n, index=5):
    sys.stdout.write('\rProcessing %s%s' % (n % index * '.', (index - 1 - n %
        index) * ' '))
sys.stdout.write('\rProcessing %s' % (n % index * '.'))
sys.stdout.flush()
print a progress-bar processing in Python