here2share

# Tk_Alpha_Art_Test_7.py

Oct 15th, 2021
1,133
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Tk_Alpha_Art_Test_7.py ZZZ
  2.  
  3. from Tkinter import *
  4. from PIL import Image, ImageTk
  5. from itertools import combinations
  6. import string
  7. import random
  8. import tempfile
  9. import webbrowser
  10.  
  11. srcfilename=tempfile.mktemp(".py", "1400x680_")
  12. srcfilename=srcfilename.rsplit('\\',1)[0]+'\\alpha1400x680art.py'
  13. print srcfilename
  14.  
  15. rndi = random.randint
  16. rndc = random.choice
  17.  
  18. ww = 1400
  19. hh = 690
  20.  
  21. root = Tk()
  22. root.title("Tk_Alpha_Art.py")
  23. root.geometry("%dx%d+0+0"%(ww,hh))
  24.  
  25. aaa = list(string.uppercase)
  26. bbb = list(string.lowercase)
  27.  
  28. ppp = [a+b for a in aaa+bbb for b in aaa+bbb]
  29. L = len(ppp)
  30. print L
  31. rgb2 = []
  32.  
  33. for y in range(hh):
  34.     for x in range(ww):
  35.         rgb2 += ['('+'+'.join([ppp[z%L]+'_' for z in (x+hh,y)])+')']
  36. 0
  37.  
  38. ttt = 'alpha_art = lambda zzzzz : '
  39.  
  40. abc = ttt+'['+','.join(rgb2)+']'
  41.  
  42. '''
  43. temp=open(srcfilename, 'w')
  44. temp.write(abc)
  45. temp.close()
  46. webbrowser.open_new_tab(srcfilename)
  47. import alpha1400x680art
  48. '''
  49.  
  50. exec(abc)
  51.  
  52. def draw():
  53.     image.putdata(rgb_)
  54.     photo = ImageTk.PhotoImage(image)
  55.     canvas.create_image(0,0,image=photo,anchor=NW)
  56.     canvas.update()
  57. 0
  58.  
  59. canvas = Canvas(root, width=ww, height=hh)
  60. canvas.pack()
  61.  
  62. image = Image.new("RGB", (ww,hh), (255,255,255))
  63.  
  64. ccccc = 255**3*2
  65.  
  66. i = rndi(0,ccccc)
  67. t = 60000
  68. incr = range(-t,t)
  69. ccc = 50
  70. polar = rndc(incr)
  71.  
  72. while 1:
  73.     for p in ppp:
  74.         t = str(i)
  75.         i = (i+polar)
  76.         ccc = ccc-1
  77.         if not ccc:
  78.             ccc = rndi(10,ww/4)
  79.             polar = rndc(incr)
  80.         exec(p+'_='+t)
  81.     rgb_ = alpha_art(0)
  82.     '''
  83.     '''
  84.     draw()
RAW Paste Data