← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #203633]: Tablular Data inside Sikuli?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
UTL=(
(r"http://url1";, "title1"), 
(r"http://url2";, "title1"),
(r"http://url3";, "title1") )

for i in range (len(UTL)):
    print "URL:", UTL[i][0], "Title:", UTL[i][1])

You might put the stuff in a file like
http://url1; title1
http://url2; title2
http://url3; title3

and read it into your list:

UTL = []
inp = file("some_file.txt")
for line in inp.readlines():
    UTL.append(line.strip().split(";"))

for i in range (len(UTL)):
    print "URL:", UTL[i][0], "Title:", UTL[i][1])

pls. do not blame me for syntax errors - not tested ;-)

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