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
           sys.stdout.write(xchar)
           sys.stdout.flush()
           sleep(1)

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.

jross
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to