1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import csv csvfilename = "server_L2.csv" print "Printing all rows" with open (csvfilename, 'rb' ) as csvfile: reader = csv.reader(csvfile, delimiter = '\t' ) for row in reader: print " " , row print "" print "Printing all rows using header line" with open (csvfilename) as csvfile: reader = csv.DictReader(csvfile, delimiter = '\t' ) for row in reader: print " " , row print "" |
article
Friday, June 10, 2016
Python read csv
Python read csv