overwrite the file if it already exists

This commit is contained in:
Andreas Zweili 2020-10-13 21:17:31 +02:00
parent 9b9aff2769
commit 5a6d0cefac
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@ import markdownify
def write_to_file(article, header):
with open(str(article.title) + ".md", 'a') as f:
markdown = markdownify.markdownify(article.html, heading_style='ATX')
with open(str(article.title) + ".md", 'w') as f:
f.write(header)
f.write(markdown)