import time

class ProgressBar: 
    def __init__(self, loop_length):
        import time
        self.start = time.time()
        self.increment_size = 100.0/loop_length
        self.curr_count = 0
        self.curr_pct = 0
        self.overflow = False
        print '% complete:',
    
    def increment(self):
        self.curr_count += self.increment_size
        if int(self.curr_count) > self.curr_pct:
            self.curr_pct = int(self.curr_count)
            if self.curr_pct <= 100:
                print self.curr_pct, 
            elif self.overflow == False:
                print "\n*!* Count has gone over 100%; likely either due to:\n*!*   - an error in the loop_length specified when " + \
                      "progress_bar was instantiated\n*!*   - an error in the placement of the increment() function"
                print '*!* Elapsed time when progress bar full: %0.1f seconds.' % (time.time() - self.start)
                self.overflow = True

    def finish(self):
        if self.curr_pct == 99:
            print "100", # this is a cheat, because rounding sometimes makes the maximum count 99. One day I'll fix this bug.
        if self.overflow == True:
            print '*!* Elapsed time after end of loop: %0.1f seconds.\n' % (time.time() - self.start)
        else:
            print '\nElapsed time: %0.1f seconds.\n' % (time.time() - self.start)

@@ -261,17 +261,17 @@
    print
- 
+(
 '%25 compl
@@ -278,10 +278,19 @@
 ete:
+ 
 ',
+ end='')
 %0A   
@@ -519,17 +519,17 @@
    print
- 
+(
 self.cur
@@ -535,16 +535,24 @@
 rr_pct, 
+end=' ')
 %0A       
@@ -610,15 +610,13 @@
 rint
- 
+(
 %22%5Cn*
-!*
  Cou
@@ -661,20 +661,16 @@
 ue to:%5Cn
-*!* 
   - an e
@@ -768,20 +768,16 @@
 tiated%5Cn
-*!* 
   - an e
@@ -826,16 +826,17 @@
 unction%22
+)
 %0A       
@@ -841,38 +841,34 @@
            print
- '*!* 
+('
 Elapsed time whe
@@ -888,21 +888,23 @@
 r full: 
-%25
+%7B:
 0.1f
+%7D
  seconds
@@ -905,19 +905,23 @@
 econds.'
- %25 
+.format
 (time.ti
@@ -930,32 +930,33 @@
 () - self.start)
+)
 %0A               
@@ -1002,32 +1002,38 @@
 elf):%0A        if
+ 99 %3C=
  self.curr_pct =
@@ -1035,66 +1035,17 @@
 pct 
-=
+%3C
 = 
-99:%0A            print %22
 100
-%22,
+:
  #
- this is a cheat, because
  rou
@@ -1091,35 +1091,131 @@
  99.
- One day I'll fix this bug.
+%0A            print(%22100%22, end=' ')%0A            print('%5CnElapsed time: %7B:0.1f%7D seconds.%5Cn'.format(time.time() - self.start))
 %0A   
@@ -1211,32 +1211,34 @@
 start))%0A        
+el
 if self.overflow
@@ -1268,14 +1268,10 @@
 rint
- '*!* 
+('
 Elap
@@ -1298,21 +1298,23 @@
 f loop: 
-%25
+%7B:
 0.1f
+%7D
  seconds
@@ -1309,35 +1309,39 @@
 .1f%7D seconds.%5Cn'
- %25 
+.format
 (time.time() - s
@@ -1350,16 +1350,17 @@
 f.start)
+)
 %0A       
@@ -1383,18 +1383,64 @@
    print
- '
+('%5Cn* End of loop reached earlier than expected.
 %5CnElapse
@@ -1451,13 +1451,15 @@
 me: 
-%25
+%7B:
 0.1f
+%7D
  sec
@@ -1470,11 +1470,15 @@
 .%5Cn'
- %25 
+.format
 (tim
@@ -1499,9 +1499,10 @@
 f.start)
+)
 %0A

Update to current version