LVLogo

fun little (import) progress display (command line) in python

2021-01-05 — Thomas Raschbacher (LordVan)

So I wanted some sort of progress printed while my import into tryton runs .. I just had dots to start with .. not easy to keep track though.

Came up with this fun little function to make it easier to see approximately how far (in a ASCII-graphical way:

def print_progress(ncount):
    scount = ' '          
    if ncount % 1000 == 0:
        scount = 'M'
    elif ncount % 500 == 0:
        scount = 'D'
    elif ncount % 100 == 0:
        scount = 'C'
    elif ncount % 50 == 0:
        scount = 'L'
    elif ncount % 10 == 0:
        scount = 'X'
    else:
        scount = '.'
    print(scount, end='', flush = True)

use dots in general, but dump in some roman literals to make it easier

Free & Open DNS servers Gazette Concert over