Change file path for quotes
From quotes/author/title/quotes.csv To quotes/author/title.csv
This commit is contained in:
parent
f7f14090ed
commit
8ceb2d05c3
1 changed files with 4 additions and 3 deletions
|
@ -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)
|
Loading…
Reference in a new issue