Skip to content

Instantly share code, notes, and snippets.

View rebeccabilbro's full-sized avatar

Rebecca Bilbro rebeccabilbro

View GitHub Profile
@rebeccabilbro
rebeccabilbro / mgen.py
Last active August 29, 2015 14:10 — forked from bbengfort/mgen.py
#!/usr/bin/env python
##########################################################################
## Imports
##########################################################################
import sys
import argparse
import traceback
import numpy as np
import os
import sqlite3
def create_tables(conn):
conn.execute("CREATE TABLE contacts (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT)")
conn.commit()
def connect(path="contacts.db", syncdb=False):
"""
Connects to the database and ensures there are tables.
import os
import sqlite3
def create_tables(conn):
conn.execute("CREATE TABLE contacts (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT)")
conn.commit()
def connect(path="contacts.db", syncdb=False):
"""
Connects to the database and ensures there are tables.