Problems with sys.stout.flush()

Joel Ross joelc at
Sat May 23 19:19:11 CEST 2009

Thanks for all the help guys. I got it to work correctly with this

class progress:

     def __init__(self):
        self.already = 0

     def progressbar(self, number, total,  char):

        percentage = int(100 - round(number*100.0/total))
        if percentage > 0:
            xchar = char * (percentage-self.already)
            self.already = percentage

Keeping track of the characters that had already been printed solved my 
main problem thanks Dave and everyone else for helping me out with this 
issue. Now I can move onto next one.


More information about the Python-list mailing list