1.1 --- a/examples/PyGmy/ppygmy.py Sun Jan 14 21:56:31 2007 +0000
1.2 +++ b/examples/PyGmy/ppygmy.py Sun Jan 14 22:28:43 2007 +0000
1.3 @@ -7,7 +7,7 @@
1.4 --------
1.5
1.6 Copyright (C) 2005 Dave Griffiths
1.7 -Copyright (C) 2006 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2006, 2007 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or
1.11 modify it under the terms of the GNU General Public License
1.12 @@ -27,6 +27,7 @@
1.13 import Image, ImageDraw, random, copy
1.14 from math import *
1.15 import pprocess
1.16 +import sys
1.17
1.18 def sq(a):
1.19 return a*a
1.20 @@ -392,7 +393,8 @@
1.21 self.count = self.count + 1
1.22 sx += 1
1.23
1.24 - percentstr = str(int((self.count/float(self.total))*100))+"%"
1.25 - print "\b\b\b"+percentstr
1.26 + percent = int((self.count/float(self.total))*100)
1.27 + sys.stdout.write(("\010" * 9) + "%3d%% %3d" % (percent, sy))
1.28 + sys.stdout.flush()
1.29
1.30 # vim: tabstop=4 expandtab shiftwidth=4