← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #265776]: Is it possible to join a multiline string using python regex in Sikuli??

 

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

    Status: Solved => Open

eduardobedoya is still having a problem:
But RaiMan

you are setting

Names ='''
name1
name2
name3
'''
an then with simply using...
namelist = names.split()[0:]

printout:
['name1', 'name2', 'name3']

shure, it works fine, but....

In my case, I receive the name1, name2, name3 from clipboard, and so I use
Names = App.getClipboard();
in order to store all names in Names variable
but doing so, my Names variable is very different than the Names you are setting
Names ='''name1,
name2,
name3
'''

So when I use
namelist = names.split()[0:]
I get...
[u'name1', u'name2', u'name3']

How I can get a variable like the one that you set?

I guess the variable I have is not a multine variable, but a string with
many carriage returns

Also I have tried using regex in order to simply remove the \r\n from my Names variable
newNames = re.sub(r"\r\n", " ", Names)
why is that???

please tell me, how can I remove the \r\n (new lines) form my clipboard,
Iam stuck with this

THanks Advanced.

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