← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #250984]: How convert org.sikuli.script.Pattern in string?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
what you posted is not the complete code (it cannot produce the
mentioned error ;-)

this works:
import re
MY_MAP = { "MY_MAP" : {
   OS.LINUX: ("P(image_1.png) S: 0.93","P(image_2.png) S: 095","P(image_3.png) S: 0.95")
                                              }
                     }
pImageMap = MY_MAP["MY_MAP"][OS.LINUX]
for x in pImageMap:
           print "My map: %s" % x
           image_parse = re.search('\((.*)\)',x)
           print "image parsed: %s"% image_parse.group(1)

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