Copy Pattern Object

Asked by Jeff_Vallis

I have images which I would like to list.

and would like to replace the path of the image with some text

v_User_Path = "Some stuff"

so I tried v_Test = v_Image.replace(v_User_Path,"YourPath")

Result
AttributeError ( 'Pattern' object has no attribute 'replace'

is it possible to do this or is the from a Pattern Object

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

If I understand right, then you can do the following:

currentName = somePattern.getFilename()

newFilename = doSomethingWith(currentName) # modify the filename

somePattern.setFilename(newFilename)

Revision history for this message
Jeff_Vallis (vallis-pj) said :
#2

Thanx just what I wanted