import csv
class Reader(object):
def __init__(self):
self.names = []
self.idigit = []
self.fileReader_list=[]
self.fileReader = csv.reader(open("survey_result.csv", "rb"))
self.fileReader_list.extend(self.fileReader)
for column in self.fileReader_list:
self.names.append(column[1])
self.idigit.append(column[2])
del self.names[0]
del self.idigit[0]
X = Reader()
for i, names in enumerate(X.names):
print names, X.idigit[i]
Ch, Sbb 6748
Oudfd, Sufdfdfy 8473
Sdfdfu, Radfdf 5667
Adfn, Mudfmmdfd 4290
Wodfdf, Yeddfdfon 8066
Chdfdng, Widfdfn 3325
Badfd, Sadfdf 4742
I want to sort them out. I tried
k = names, X.idigit then print k, however, this turns everything into a list, which I do not want to do.
Is there any alternative suggestion to do it?
I do this because I need to use textwrap later to formulate these data into a wrap table