From 8ceb2d05c3050c96b7c86a33d1763f6196a47005 Mon Sep 17 00:00:00 2001 From: "Jessica L. Hacker" Date: Fri, 20 Sep 2019 08:26:21 -0700 Subject: [PATCH] Change file path for quotes From quotes/author/title/quotes.csv To quotes/author/title.csv --- templates/reorganize.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/reorganize.py b/templates/reorganize.py index 7edb3f5..36751ce 100644 --- a/templates/reorganize.py +++ b/templates/reorganize.py @@ -23,7 +23,7 @@ shutil.rmtree('quotes') for quote in quotes: # path: ./quotes/author/work/ - path = 'quotes/' + quote[1] + '/' + quote[3] + '/' + path = 'quotes/' + quote[1] + '/' # https://stackoverflow.com/a/600612/11736197 try: @@ -34,6 +34,7 @@ for quote in quotes: else: raise - with open(path + 'quotes.csv', 'a') as csvfile: - writer = csv.writer(csvfile, delimiter=',', quotechar='`') + # file path: ./quotes/author/title.csv + with open(path + quote[3] + '.csv', 'a') as csvfile: + writer = csv.writer(csvfile, delimiter=',', quotechar='`', quoting=csv.QUOTE_ALL) writer.writerow(quote) \ No newline at end of file