Traceback --- error seen when trying to capture and store image using shutil

Asked by Test App

Hi

I have used the below code to capture and store an Image

img = Screen(0).capture(27,170,963,159)
import shutil
shutil.move(img,"C:\\Sikuli\\test1.png")
import os.path
shutil.move(img,os.path.join(getBundlePath()),"test.png")

And this is the error i get

TypeError ( coercing to Unicode: need string, org.sikuli.script.ScreenImage type found )
[error] --- Traceback --- error source first line: module ( function ) statement 293: shutil ( move ) File "C:\Sikuli\sikulix.jar\Lib\shutil.py", line 293, in move

Please tell me what to do to remove this erroe

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
Last query:
Last reply:
Revision history for this message
Best masuo (masuo-ohara) said :
#1

try this code
img = Screen(0).capture(27,170,963,159).getFile()

Revision history for this message
Test App (laxmisaketha) said :
#2

Thanks masuo, that solved my question.