twitools/makedb.py

21 lines
343 B
Python
Raw Normal View History

2015-03-09 17:32:24 +00:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sqlite3, sys
try:
file = sys.argv[1]
except IndexError:
file = "Database.db"
if os.path.isfile(file):
os.remove(file)
conn = sqlite3.connect(file)
curs = conn.cursor()
curs.execute("CREATE TABLE tweets(tweet_id numeric, timestamp text, text text);")
conn.commit()
conn.close()