CSV Reading Name Error....
I'm currently raging at this, it worked a little earlier but then I added a new line and now it's stopped altogether.
Can anyone point out the obv flaw?
Sikuli code:
-------
import csv
xReader = file("C:
xReader.readline()
for line in xReader:
(ref, val) = eval(''.join(('[', line.strip(), ']')))
if (Ref == "Smoker"):
if (Ref == "Gender"):
if (Ref == "Marital"):
if (Ref == "Forename"):
if (Ref == "DOB"):
Settings.DOB = Val
print Settings.Smoker
print Settings.Gender
print Settings.Marital
print Settings.Forename
print Settings.DOB
-------
newbie.csv file
-------
Smoker,n
Gender,m
Marital,s
Forename,Test
DOB,t-50y
-------
Error Message
-------
[error] An error occurs at line 5
[error] Error message: Traceback (most recent call last):
File "C:\Users\
(ref, val) = eval(''.join(('[', line.strip(), ']')))
File "", line 1, in
NameError: name 'Gender' is not defined
-------
Before people ask, I've made sure the files are all in the correct place etc and saved in the .CSV format.
If I'm being a tool don't hold back, otherwise I won't learn. :)
Thanks,
Dave
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: