To implement a status bar like below:
[========== ] 45% [================ ] 60% [==========================] 100%
Easiest is still
import sys total_records = 1000 for i in range (total_records): sys.stdout.write('\rUpdated record: ' + str(i) + ' of ' + str(total_records)) sys.stdout.flush()
Key is to convert the integer type to string.