Re: [Sikuli-driver] [Question #233894]: how to save a object to a file

2013-08-12 Thread RaiMan
Question #233894 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233894

Status: Open = Answered

RaiMan proposed the following answer:
--1. p is a Match object, that only knows, where on the screen the
picture Vefifjf.png was found.

--2. Why do you want to save a picture, that you already have as file: script 
folder/Vefifjf.png
the file's path is:
import os # put it at the beginning of the script

pathImg = os.path.join(getBundlePath(), Vefifjf.png)


--3. you might copy the picture to some other place using:
import shutil # put it at the beginning of the script

img = Vefifjf.png
p=find(img)
shutil.copy(img, E:\\WorkPlc\\a.png) # switching to .jpg not possible this way

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #233894]: how to save a object to a file

2013-08-12 Thread RaiMan
Question #233894 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233894

RaiMan proposed the following answer:
Sorry, again:

--3. you might copy the picture to some other place using:
import shutil # put it at the beginning of the script
import os # put it at the beginning of the script

img = Vefifjf.png
p=find(img)
shutil.copy(os.path.join(getBundlePath(), img), E:\\WorkPlc\\a.png) # 
switching to .jpg not possible this way

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #233894]: how to save a object to a file

2013-08-12 Thread jack.cai
Question #233894 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233894

jack.cai posted a new comment:
Thank you RaiMan.  I understand your mean.

in fact,  above img is a input text, have a Verification Code on img's
right

so my code as below:
p=find(Vefifjf.png)
# region of verification code
p.right(50)

you know the verification code will change each time, i want save this 
code(pic) to a file, then to another program to handle(discern).
do you have better way.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #233894]: how to save a object to a file

2013-08-12 Thread RaiMan
Question #233894 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233894

RaiMan proposed the following answer:
Sorry, copy and paste typos.

import shutil # put it at the beginning of the script

shutil.move(code, E:\\WorkPlc\\a.png) # moves it to the permanent
storage

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #233894]: how to save a object to a file

2013-08-12 Thread RaiMan
Question #233894 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233894

RaiMan proposed the following answer:
this should do it:

mport shutil # put it at the beginning of the script
import os # put it at the beginning of the script

img = Vefifjf.png
p=find(img)
code = capture(p.right(50)) # creates a temp image file of the region
shutil.move(img, E:\\WorkPlc\\a.png) # moves it to the permanent storage

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #233894]: how to save a object to a file

2013-08-12 Thread jack.cai
Question #233894 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233894

Status: Answered = Solved

jack.cai confirmed that the question is solved:
RaiMan, thank you very much.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #233894]: how to save a object to a file

2013-08-12 Thread jack.cai
Question #233894 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233894

jack.cai confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp