Guest User

Untitled

a guest
Jan 12th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import timeit
  2. import PIL.ImageGrab
  3.  
  4. def get_screen():
  5.     return PIL.ImageGrab.grab()
  6.  
  7.  
  8. def get_pixels():
  9.     screen = get_screen()
  10.     t = timeit.Timer()
  11.  
  12.     for x in range(1, 1000):
  13.         for y in range(1, 500):
  14.             PixelString = ""
  15.             #PixelString = PIL.ImageGrab.grab().load()[300,i]
  16.             #PixelString = PIL.ImageGrab.grab().getpixel()[300, i]
  17.             print(screen.load()[x, y])
  18.     print(t.timeit())
  19.  
  20. get_pixels()
Advertisement
Add Comment
Please, Sign In to add comment