' %( fs,color,fs, "generated by skimpyGimpy, created by Aaron Watters")] a = L.append maxX = maxY = 0 - for (x,y) in pixelDict.keys(): + for (x,y) in list(pixelDict.keys()): maxX = max(x, maxX) maxY = max(y, maxY) - rY = range(maxY) + rY = list(range(maxY)) for x in range(maxX+1): lineList = [" "] * maxY for y in rY: - if pixelDict.has_key( (x,y) ): + if (x,y) in pixelDict: lineList[y] = mark a("".join(lineList)) a("") @@ -350,11 +350,11 @@ this.smear() this.speckle() def formatPNG(this, filename, color=(0x77, 0x77, 0x77), scale=2): - import KiPNG + from . import KiPNG this.prepare() pD = this.pixelDict D = {} - for (y,x) in this.pixelDict.keys(): + for (y,x) in list(this.pixelDict.keys()): p = (x,-y) D[p] = 1 KiPNG.DictToPNG(D, filename, color, scale) @@ -367,10 +367,10 @@ #g = gimpyString(string.lowercase) g = gimpyString(string) if png is not None: - print "writing png format to", png + print("writing png format to", png) g.formatPNG(png) else: - print g.formatAll() + print(g.formatAll()) def clean(s, points=None): if points is None: @@ -378,7 +378,7 @@ s = s.lower() L = [] for c in s: - if points.letterToPoints.has_key(c): + if c in points.letterToPoints: L.append(c) return "".join(L) @@ -393,7 +393,7 @@ (20,30), (0,0), ] - print curveTable(points) + print(curveTable(points)) pagetemplate = r""" @@ -458,16 +458,16 @@ (20,30), (0,0), ] - print makePage("action", points, "false") + print(makePage("action", points, "false")) def test0(): msize = 30 - print "" - print + print(test) + print("") + print("