Allow file name to be passed to csvdb function

This commit is contained in:
Klaus-Uwe Mitterer 2016-04-07 21:04:13 +02:00
parent 059633a32a
commit 77e66918db

View file

@ -4,11 +4,11 @@ import tools
import sqlite3, csv, sys
def makeDB(path=tools.dbpath()):
def makeDB(path=tools.dbpath(), infile='tweets.csv'):
try:
infile = open('tweets.csv')
infile = open(infile)
except IOError:
raise IOError("Please make sure that the tweets.csv from the Twitter download is located in this directory.")
raise IOError("Unable to read %s." % infile)
input = list(csv.reader(infile))