weckbot/makedb.py
2015-03-18 22:42:54 +01:00

20 lines
373 B
Python
Executable file

#!/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, sender text, comment text, sent numeric);")
conn.commit()
conn.close()