← Back to team overview

sikuli-driver team mailing list archive

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

 

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

    Status: Answered => Open

Kartheek is still having a problem:
yeah.. i referred python tutorials, but while coming to this situation
i'm not sure the problem is where. Here i'm pasting my sniipet code
kindly look into once and give me the solution.

######
import csv
Col1 = "ColumnName1"
Col2 = "ColumnName2"
Col3 = "ColumnName3"
mydictionary={Col1:[], Col2:[], Col3:[]}
csvFile = csv.reader(open("D:\\Sikuli\\example1.csv", "rb"))
for row in csvFile:
  mydictionary[Col1].append(row[0])
  mydictionary[Col2].append(row[1])
  mydictionary[Col3].append(row[2])

for row in csvFile:
  col1, col2, col3 = row
  print "%s: %s, %s" % (col1, col2, col3)
#####
Here i want to print single column, please provide me solution
Thank you

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