image - python screenshot file moved or renamed -


i wrote code on python suppost take screenshot , show it. shis code:

from pil import imagegrab,image import pil  def screenshot():     num=1     takescsh = imagegrab.grab()     takescsh.save(str(num)+'.png')     takescsh.show()     num=num+1  x=raw_input() while x!='stop':     screenshot()     x=raw_input() 

it opens windows picture viewer in picture viewer says "it looks file moved or renamed" idea why that?

in screenshot function, num equal 1. so, each , every time call screenshot, file rewritten on disk. try like:

def screenshot(num):     takescsh = imagegrab.grab()     takescsh.save(str(num) + '.png')     takescsh.show()   count = 1 while 'capturing':     screenshot(count)     count += 1     if raw_input() == 'stop':         break 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -