12 lines
238 B
Python
12 lines
238 B
Python
import sqlite3
|
|
import csv
|
|
conn = sqlite3.connect('csvdata.db')
|
|
c = conn.cursor()
|
|
|
|
file = open('employees.csv')
|
|
headers = file.readline().strip().split(',')
|
|
out = [dict(zip(headers, line.strip().split(','))) for line in file]
|
|
|
|
|
|
|
|
print(out) |