← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #263844]: how to read single row from csv file using python in sikuli

 

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

    Status: Open => Answered

RaiMan proposed the following answer:

def lineFromCSV(file, num):
    data = csv.reader(open(file), delimiter=' ', quotechar='|')
    for i in range(num+1) :
        num = data.next()
    return num

file = "D:\\Sikuli\\example1.csv"

popup( ', '.join(lineFromCSV(file, num)))

… no idea, what happens if num > number of available lines in the csv

BTW: there are tons of examples in the net: google Python csv

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