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

(0 comments)

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

Currently unrated

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

Recent Posts

Archive

2021
2020
2019
2018
2014
2012
2011
2010
2009
2008
2007

Categories

Authors

Feeds

RSS / Atom