Week 4 Code For Jupyter
Week 4 Code For Jupyter
import sqlite3
conn = sqlite3.connect('rosterdb.sqlite')
cur = conn.cursor()
# Do some setup
cur.executescript('''
DROP TABLE IF EXISTS User;
DROP TABLE IF EXISTS Member;
DROP TABLE IF EXISTS Course;
fname = "roster_data.json"
if len(fname) < 1:
fname = 'roster_data_sample.json'
# [
# [ "Charley", "si110", 1 ],
# [ "Mea", "si110", 0 ],
str_data = open(fname).read()
json_data = json.loads(str_data)
name = entry[0];
title = entry[1];
role=entry[2];
# print((name, title,role))
conn.commit()