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
Post a Comment