close

import csv

import os

import sys

 

path = './csv_dir/'

os.chdir(path)

 

if os.getcwd() != path:

     print('ERROR: the file path incorrect.')

     sys.exit()

file = open(path + 'data.csv', 'r')

csvData = csv.reader(file)

for row in csvData:

     print(row)

file.close()

arrow
arrow
    文章標籤
    python csv
    全站熱搜

    楓綺 發表在 痞客邦 留言(0) 人氣()