twitools/makedb.py
2015-04-13 22:58:32 +02:00

21 lines
344 B
Python
Executable file

#!/usr/bin/env python3
# -*- 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()