Archive for April, 2013

How to show a Percent Complete in Python

from __future__ import division
import sys

sys.stdout.write('\r')
sys.stdout.write('%.2f%% complete' % (number / total * 100,))
sys.stdout.flush()