Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_Alpha_Art_Test_2.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 = x*hh+y
- abc[t] += oALPHA[x%L]
- abc[t] += oALPHA[(x-y)%L]
- t = x+y*ww
- abc[t] += oALPHA[x%L]
- abc[t] += oALPHA[(x)%L]
- 0
- abc = ['(({}*{})%({}+{}))'.format(*z) for z in 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 = 16777215
- while 1:
- for zzz in alpha:
- ttt = str(rnd(0,vvv/2))
- exec(zzz+'='+ttt)
- rgb = alpha_art(0)
- draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement