Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_250x250_Each_Pixel_A_Random_Color_Test_2.py
- from Tkinter import *
- import random
- def oRGB(rgb): # pass
- r,g,b = rgb
- return "#%02x%02x%02x" % (r,g,b)
- ww = 250
- hh = 250
- root = Tk()
- root.title("Tk 250x250 Each Pixel A Random Color")
- root.geometry("%dx%d+0+0"%(ww,hh))
- canvas = Canvas(root, width=ww, height=hh)
- canvas.grid()
- while 1:
- for x in range (ww):
- for y in range(hh):
- rgb = tuple([random.randint(0,255) for rgb in 'zzz'])
- canvas.create_line((x,y,x+1,y),fill=oRGB(rgb))
- canvas.update()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement