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

Asked by Test App on 2017-08-10

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:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
masuo
Solved:
2017-08-11
Last query:
2017-08-11
Last reply:
2017-08-11
Best masuo (masuo-ohara) said : #1

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

Test App (laxmisaketha) said : #2

Thanks masuo, that solved my question.