I have a py file using Qt Designer,i have a combobox and i read from a csv file.If the combobox choice is in the file,it prints something.
At the top of the script it says that: # -*- coding: utf-8 -*-
So, the error i get is this:
PyQt4.QtCore.QString(u'choice') is not in list
The ‘choice’ is of course in list.I believe its an encoding problem,but that’s all i got.
u’choice’ is a string and the list contains strings.
This is how i add items to the list:
import csv
list1=csv.reader(open('file.csv', "rb"))
list2=[]
for i in list1:
list2.append(i)
Any ideas?Thanks.
This has got nothing to do with encodings.
The error occurs simply because there are no strings in the list read from the csv file:
The csv reader returns a list of strings for each row in the file.