From 77e66918db1328ce41e7fa96d8d0e34327a08cc7 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Thu, 7 Apr 2016 21:04:13 +0200 Subject: [PATCH] Allow file name to be passed to csvdb function --- csvdb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csvdb.py b/csvdb.py index 153f413..c3585f8 100755 --- a/csvdb.py +++ b/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))