Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Py3Tk_Gradient_Art_1400x700.py
- # did quite the tinkering of this code and can't figure out why the result is not quite what I expected
- from tkinter import *
- from PIL import Image, ImageTk
- import string
- import time
- import random
- import math
- from itertools import product
- from ast import literal_eval as make_tuple
- ri_ = random.randint
- rs_ = random.shuffle
- rc_ = random.choice
- tx_ = time.time
- ww = 1400
- hh = 700
- root = Tk()
- root.title("Tk_Gradient_Art_1400x700")
- root.geometry("%dx%d+-10+0"%(ww,hh))
- alpha = string.ascii_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)
- v = []
- 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]:
- v.append(abc[z])
- xy[t].append(abc[z])
- 0
- print('...')
- vvv = []
- for z in list(set(v)):
- vvv.append((v.index(z),z))
- print('...')
- vvv.sort()
- matrix = '['+','.join(['Q[{}+{}+{}+{}]'.format(*z) for z in xy])+']'
- print ('...')
- p = 1079281
- ppp = p*2
- t = len(matrix)
- exec('def o(): return '+matrix)
- print('...')
- 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)
- print('...')
- vars = []
- for k,v in enumerate(vvv):
- exec(v[1]+'='+str(Q[k%LQ]))
- vars += [v[1]]
- Lv = len(vars)/10
- print('...')
- 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 = LQ/4
- iii = (255**3)/4
- wave = []
- for z in range(200):
- for i in range(201-z):
- wave.append((z-100)*0.005)
- Lw = len(wave)
- print('...')
- rnd = 3
- for _ in range(9999999):
- for z in vars:
- rnd = rc_(wave)
- iii = (iii+rnd)%ccc
- exec(z+'='+str(int(iii)))
- rgb = o()
- draw()
- while 1:
- for _ in range(9999999):
- rs_(vars)
- for z in vars[:10]:
- rnd = rc_(wave)
- iii = (iii+rnd)%ccc
- exec(z+'='+str(int(iii)))
- rgb = o()
- draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement