Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_Alpha_Art_Test_1400x700.py
- from Tkinter import *
- from PIL import Image, ImageTk
- import string
- import time
- import random
- import math
- from itertools import product
- ri_ = random.randint
- rs_ = random.shuffle
- rc_ = random.choice
- tx_ = time.time
- ww = 1400
- hh = 700
- root = Tk()
- root.title("Tk_Alpha_Art_Test_1400x700")
- root.geometry("%dx%d+-10+0"%(ww,hh))
- alpha = string.letters
- xy = [[] for z in range(ww*hh)]
- abc = []
- for x in alpha:
- for y in alpha+'0123456789':
- for z in alpha+'0123456789':
- t = x+y+z
- if not t.isalpha():
- exec(t+'=(255,255,0)')
- abc.append(t)
- L = len(abc)
- print L
- vars = []
- for y in range(hh):
- for x in range(ww):
- t = y*ww+x
- a = y
- b = x+ww
- c = y+ww*2-x
- d = y+ww*3+x
- for z in [a,b,c,d]:
- vars.append(abc[z])
- xy[t].append(abc[z])
- 0
- vars = list(set(vars))
- matrix = '['+','.join(['{}+{}+{}+{}'.format(*z) for z in xy])+']'
- p = 1079281
- ppp = p*2
- # print matrix
- exec("def o(): return "+str(matrix))
- rainbow=[]
- def z(r,g,b):
- rainbow.append((r,g,b))
- r,g,b=255,0,0
- for g in range(256):
- z(r,g,b)
- for r in range(254, -1, -1):
- z(r,g,b)
- for b in range(256):
- z(r,g,b)
- for g in range(254, -1, -1):
- z(r,g,b)
- for r in range(256):
- z(r,g,b)
- for b in range(254, -1, -1):
- z(r,g,b)
- Q = rainbow[1:-1]+rainbow[::-1]
- LQ = len(Q)
- for k,v in enumerate(vars):
- exec(v+'='+str(Q[k%LQ]))
- 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,225))
- ccc = (255**3)/4
- while 1:
- for _ in xrange(9999999):
- for zzz in vars:
- exec(zzz+'='+str(ri_(0,ccc)))
- rgb = o()
- draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement