here2share

# Tk_seq_putdata.py

Sep 26th, 2021
879
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Tk_seq_putdata.py
  2.  
  3. from Tkinter import *
  4. from PIL import Image, ImageTk
  5. import random
  6.  
  7. ww = 600
  8. hh = 600
  9. root = Tk()
  10. root.title("Tk_seq_putdata")
  11. root.geometry("%dx%d+0+0"%(ww,hh))
  12.  
  13. def rgb2hex(r,g,b):
  14.     return '#%02X%02X%02X'%(r,g,b)
  15.  
  16. def draw():
  17.     image.putdata([z*i for z in range(360000)])
  18.     photo = ImageTk.PhotoImage(image)
  19.     canvas.create_image(0,0,image=photo,anchor=NW)
  20.     canvas.update()
  21. 0
  22.  
  23. canvas = Canvas(root, width=ww, height=hh)
  24. canvas.pack()
  25.  
  26. image = Image.new("RGB", (600,600), (255,255,255))
  27.  
  28.  
  29. rgb = 16777215
  30.  
  31. for i in range(1,rgb):
  32.     draw()
RAW Paste Data