read .csv after select the file with a button in python
<p>I would like to read a .csv file after the fils with a button but I have an error after selecting the file :</p>

<pre><code>file = open(fname, "rb")
TypeError: coercing to Unicode: need string or buffer, QStringList found
</code></pre>

<p>My code is :</p>

<pre><code>from selenium.common.exceptions import TimeoutException from PyQt4 import QtGui, QtCore
import csv

def import_csv(self):

fname = QtGui.QFileDialog.getOpenFileNames(self, "Open Data File", "", "CSV     data files (*.csv)")

file = open(fname, "rb")
try:
    reader = csv.reader(file)
    for row in reader:
    print row[1]

finally:
    file.close()
</code></pre>