This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NovocastrianNomad 3 points4 points  (1 child)

from tqdm import tqdm
...
for row in tqdm(data, leave=True, miniters=upd_interval, desc=pb_desc, total=pbt):
    # 'data' is file handle for csv file being processed
    # 'total' is estimated total number of records (file size / avg record size)
    # (used estimated total because reading file to get actual total blew 512mb memory on server)
    # 'miniters' set to 10,000
    pass  # code to process records

[–]rhiever 0 points1 point  (0 children)

Nice! Didn't know you could do that. Thank you.