I'm trying to grab a screenshot every 30 seconds and display it on my GUI, heres what I've got so far.
Code:
from Tkinter import *
from PIL import ImageGrab
window = Tk()
box = (100,100,400,400)
MyImage = ImageGrab.grab(box)
MyPhotoImage = PhotoImage(file=MyImage) #I know this is where its going wrong, just not sure how to fix it
PictureLabel = Label(window, image=MyPhotoImage)
PictureLabel.pack()
window.mainloop()
Python doesnt like the fact I haven't saved the image, is there a possible way to do this without saving the image (not much point since its being renewed every 30 seconds)
Its also not saving every 30 seconds yet, is there a simple way to do this without the program hanging? As I could just use a time.sleep(30) but the program would just freeze up for 30 seconds take a picture then freeze again.
Thanks :)