print a progress-bar processing in python,sys.stdout.flush()