描述
csv_read() 讀取csv文件函數
csv_read() 接收一個(gè)參數,第一個(gè)參數為csv文件路徑
語(yǔ)法
以下是 csv_read() 的語(yǔ)法:
csv_read(path)
參數
● path [str] csv文件路徑。
返回值
返回一個(gè)dict類(lèi)型的數據
實(shí)例
以下展示了使用 csv_read() 的實(shí)例:
from kyger.common import csv_read print(csv_read('test.csv'))
以上實(shí)例運行后輸出的結果為:
{'header': ['編號', '課程', '講師'], 'rows': [('1', 'Python', 'fighter.Lu'), ('2', 'C#', 'fighter.Lu'), ('3', '.Net', 'fighter.Lu')]}
適應版本
v1.0.1