Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_Alpha_Art_Test_4.py ZZZ
- from Tkinter import *
- from PIL import Image, ImageTk
- from itertools import combinations
- import string
- import random
- rnd = random.randint
- ww = 800
- hh = 600
- root = Tk()
- root.title("Tk_Alpha_Art.py")
- root.geometry("%dx%d+0+0"%(ww,hh))
- alpha = list(string.letters)
- oALPHA = alpha + alpha[:-1:-1]
- L = len(oALPHA)
- abc = [[] for z in range(ww*hh)]
- L2 = len(abc)
- for y in range(hh):
- for x in range(ww):
- t = y*ww+x
- abc[t] += oALPHA[(x**2)%L]
- abc[t] += oALPHA[((x**2)+26-y)%L]
- #t = x*hh+y
- abc[t] += oALPHA[(y**2)%L]
- abc[t] += oALPHA[((y**2)+26-x)%L]
- 0
- abc = ['({}+{}+{}+{})'.format(*z) for z in abc]
- #print abc
- ttt = 'alpha_art = lambda zzz : '
- abc = ttt+'['+','.join(abc)+']'
- exec(abc)
- def draw():
- image.putdata(rgb)
- photo = ImageTk.PhotoImage(image)
- canvas.create_image(0,0,image=photo,anchor=NW)
- canvas.update()
- 0
- canvas = Canvas(root, width=ww, height=hh)
- canvas.pack()
- image = Image.new("RGB", (ww,hh), (255,255,255))
- vvv = 16581375
- i = 16581375/4
- print
- while i > 0:
- for zzz in alpha:
- ttt = str(rnd(0,vvv/4))
- # ttt = str(i)
- exec(zzz+'='+ttt)
- i -= 1
- rgb = alpha_art(0)
- draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement