← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #677297]: ClassCastException: class org.python.core.PyObjectDerived cannot be cast to class org.python.core.PyString

 

Question #677297 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/677297

    Status: Open => Answered

RaiMan proposed the following answer:
Must have something to do with the base64 stuff, because this works:

ci = capture(0,0,10,10)
print "***** capture:", ci
fci = open(ci, 'rb')
print "***** open:", fci
sci = fci.read()
print ("***** read: ", sci)

and prints:
***** capture: C:\Users\RaiMan\AppData\Local\Temp\Sikulix_1880007\sikuliximage-1546535584204.png
***** open: <open file u'C:\\Users\\RaiMan\\AppData\\Local\\Temp\\Sikulix_1880007\\sikuliximage-1546535584204.png', mode 'rb' at 0xc>
('***** read: ', '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\n\x00\x00\x00\n\x08\x02\x00\x00\x00\x02PX\xea\x00\x00\x00\x14IDATx^c\xf0\n\x89\xc4\x83\x180\x85F\xa5C"\x01i\xd4`}\n\x952\xa4\x00\x00\x00\x00IEND\xaeB`\x82')

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.