sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #26711
[Question #250984]: How convert org.sikuli.script.Pattern in string?
New question #250984 on Sikuli:
https://answers.launchpad.net/sikuli/+question/250984
Hello,
I need a way to convert into a string an object type: org.sikuli.script.Pattern.
I am using image map like:
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")
}
}
Then I get get map corresponding to the OS. But once I need to get value of map and print name with only keeping image name I am getting an error:
excpected str or unicode but got <type 'org.sikuli.script.Pattern'>
Here is what I am trying to do:
for x in pImageMap:
print "My map: " + str(x) <-- It works
image_parse = re.search('\((.*)\)',x)
print "image parsed: " + image_parse
Thanks in advance for help.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.