python - printing CSV in a different way -


i need print out rankinglist csv file. can printed out, that's not problem this:

[['team1', '100'], ['team2', '200'], ['team3', '300']] 

i want print out this:

team1, 100 team2, 200 team3, 300 

i found knowledge of python/ english language isn't high enough understand being explained on other stackoverflow topics here have ask simple possible piece of code i'm using

def read():     = open('casus.csv','r')     areader = csv.reader(a)     = []     row in areader:         if len (row) != 0:             = + [row]     print(a) 

if have 2 elements in each list, should work.

def read():     = open('casus.csv','r')     areader = csv.reader(a)     row in areader:         if len(row != 0):             print(row[0]+","+row[1]) 

Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -