Allow file name to be passed to csvdb function
This commit is contained in:
parent
059633a32a
commit
77e66918db
1 changed files with 3 additions and 3 deletions
6
csvdb.py
6
csvdb.py
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in a new issue