← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #235236]: how to read each row of values declared in a function(with array of values) in another script

 

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

AKR gave more information on the question:
Hi Raiman,

Solved my problem using the method you suggested
# sub.sikuli
from sikuli import *
T = [["A4", "AO-001"],
       ["A4", "AO-002"]]

# main.sikuli
import sub
for n in range(len(sub.T)):
    testcase=sub.T[n]
    print testcase
    testfile=testcase[0]
    output=testcase[1]

Also I am trying to pass the data using Excel sheet attached with a row of data passing to 
    testfile=testcase[0]
    output=testcase[1]
    draw=testcase[2]

Please advice

Thanks 
Kavitha 


-----Original Message-----
From: bounces@xxxxxxxxxxxxx [mailto:bounces@xxxxxxxxxxxxx] On Behalf Of AKR
Sent: Monday, 9 September 2013 7:56 AM
To: Kavitha Allapuram
Subject: Re: [Question #235236]: how to read each row of values declared in a function(with array of values) in another script

Your question #235236 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/235236

    Status: Answered => Open

You are still having a problem:
Hi Raiman,

Thank you so much. This is working.
I have one more question for you. Instead of passing values in an array like T = [["A4", "AO-001"],
       ["A4", "AO-002"]]
If we use Excel sheet as data. What is the way to call Excel in Sikuli and how to call each row  in the similar way of my previous question.
Thanks in advance for you kind help.

Warm Regards
Kavitha 

-----Original Message-----
From: bounces@xxxxxxxxxxxxx [mailto:bounces@xxxxxxxxxxxxx] On Behalf Of RaiMan
Sent: Friday, 6 September 2013 5:42 PM
To: Kavitha Allapuram
Subject: Re: [Question #235236]: how to read each row of values declared in a function(with array of values) in another script

Your question #235236 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/235236

    Status: Open => Answered

RaiMan proposed the following answer:
In the def you are assigning the new array to T, but T in this context is only local: T in main remains unchanged.

... on the other hand: what you are doing is some kind of overkill:

# sub.sikuli
from sikuli import *
T = [["A4", "AO-001"],
       ["A4", "AO-002"]]

# main.sikuli
import sub
for n in range(len(sub.T)):
    testcase=sub.T[n]
    print testcase
    testfile=testcase[0]
    output=testcase[1]

When using a def in this case:

# sub.sikuli
from sikuli import *
T = [["A4", "AO-001"],
       ["A4", "AO-002"]]

def AO_array():
    return T

# main.sikuli
import sub
T = sub.AO_array()
for n in range(len(T)):
    testcase=T[n]
    print testcase
    testfile=testcase[0]
    output=testcase[1]

... but more noise.

--
If this answers your question, please go to the following page to let us know that it is solved:
https://answers.launchpad.net/sikuli/+question/235236/+confirm?answer_id=0

If you still need help, you can reply to this email or go to the following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/235236

You received this question notification because you asked the question.

--
You received this question notification because you asked the question.

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