sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #41794
Re: [Question #526599]: copy a specific file by name
Question #526599 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/526599
Status: Open => Solved
Rahul Kumar confirmed that the question is solved:
Raiman, maybe you are right.
I solved my problem this way (copied code from somewhere else):
ABC.py
===========
from cStringIO import StringIO
import win32clipboard
import sys
from PIL import Image
def send_to_clipboard(clip_type, data):
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(clip_type, data)
win32clipboard.CloseClipboard()
print("-----"+sys.argv[1])
image = Image.open(sys.argv[1])
output = StringIO()
image.convert("RGB").save(output, "BMP")
data = output.getvalue()[14:]
output.close()
send_to_clipboard(win32clipboard.CF_DIB, data)
from sikuli
===============
os.system("python <path to ABC.py> " + <filepath>)
This ABC.py had to be made separate, as sikuli does not support
win32clipboard
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.