To implement a status bar like below:
[========== ] 45% [================ ] 60% [==========================] 100%
Per Steven C. Howell's comment on Mark Rushakoff's answer
j = (i + 1) / n stdout.write('\r') stdout.write('[%-20s] %d%%' % ('='*int(20*j), 100*j)) stdout.flush()
where i is the current item and n is the total number of items
i
n