PEP8 compliance
--HG-- branch : sandbox
This commit is contained in:
@@ -25,23 +25,25 @@ logging.basicConfig(level=logging.DEBUG,
|
|||||||
|
|
||||||
CODE = "#MWmBEKNQkAbqXHgUFRhdwp8&aDGVZ9utO03CYvlrI=i<7+?}(*[/|;!^-~`,:. "
|
CODE = "#MWmBEKNQkAbqXHgUFRhdwp8&aDGVZ9utO03CYvlrI=i<7+?}(*[/|;!^-~`,:. "
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
tkis = []
|
tkis = []
|
||||||
# build gui
|
# build gui
|
||||||
root = Tk.Tk()
|
root = Tk.Tk()
|
||||||
root.title("bottier")
|
root.title("bottier")
|
||||||
bu1 = Tk.Button(root, text='Quit', command= root.quit)
|
bu1 = Tk.Button(root, text='Quit', command=root.quit)
|
||||||
bu1.pack(side = Tk.BOTTOM, padx = 5, pady = 5)
|
bu1.pack(side=Tk.BOTTOM, padx=5, pady=5)
|
||||||
for s in (PIC1, PIC2, PIC3, PIC4, PIC5):
|
for s in (PIC1, PIC2, PIC3, PIC4, PIC5):
|
||||||
im = ascii2img(s)
|
im = ascii2img(s)
|
||||||
tki = ImageTk.PhotoImage(im, gamma = 2)
|
tki = ImageTk.PhotoImage(im, gamma=2)
|
||||||
tkis.append(tki)
|
tkis.append(tki)
|
||||||
la = Tk.Label(root, image = tki)
|
la = Tk.Label(root, image=tki)
|
||||||
la.pack(side = Tk.RIGHT, padx = 5, pady = 5)
|
la.pack(side=Tk.RIGHT, padx=5, pady=5)
|
||||||
|
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
root.destroy()
|
root.destroy()
|
||||||
|
|
||||||
|
|
||||||
def ascii2img(s):
|
def ascii2img(s):
|
||||||
# create the image
|
# create the image
|
||||||
# lines = StringIO(s).readlines()
|
# lines = StringIO(s).readlines()
|
||||||
@@ -54,7 +56,7 @@ def ascii2img(s):
|
|||||||
im.putpixel((x, y), CODE.find(c) * 4)
|
im.putpixel((x, y), CODE.find(c) * 4)
|
||||||
bbox = im.getbbox()
|
bbox = im.getbbox()
|
||||||
bbim = im.crop(bbox)
|
bbim = im.crop(bbox)
|
||||||
imx2 = bbim.resize((bbox[2]*2, bbox[3]*2), Image.ANTIALIAS)
|
imx2 = bbim.resize((bbox[2] * 2, bbox[3] * 2), Image.ANTIALIAS)
|
||||||
return imx2
|
return imx2
|
||||||
|
|
||||||
PIC1 = """\
|
PIC1 = """\
|
||||||
|
|||||||
Reference in New Issue
Block a user