Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_random_putdata.py
- from Tkinter import *
- from PIL import Image, ImageTk
- import random
- ww = 600
- hh = 600
- root = Tk()
- root.title("Tk_random_putdata")
- root.geometry("%dx%d+0+0"%(ww,hh))
- def rgb2hex(r,g,b):
- return '#%02X%02X%02X'%(r,g,b)
- def draw():
- image.putdata([random.randrange(16777215) for _ in range(360000)])
- 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", (600,600), (255,255,255))
- while 1:
- draw()
- 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement