📜  python csv阅读器 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:36.615000             🧑  作者: Mango

代码示例6
import csv, sys
filename = 'some.csv'
with open(filename, 'rb') as f:
    reader = csv.reader(f)
    try:
        for row in reader:
            print row
    except csv.Error as e:
        sys.exit('file %s, line %d: %s' % (filename, reader.line_num, e))