reading a CSV files columns directly into variables names with python

前端 未结 6 2035
梦毁少年i
梦毁少年i 2021-02-06 12:57

I want to read a CSV file\'s columns directly into variables. The result should be something like you would get with the following shell line: while IFS=, read ColumnName1

6条回答
  •  醉话见心
    2021-02-06 13:40

    for row in thingthatyieldslists:
      col1, col2, col3 = row
      print "%s: %s, %s" % (col1, col2, col3)
    

提交回复
热议问题