overwrite the file if it already exists
This commit is contained in:
parent
9b9aff2769
commit
5a6d0cefac
|
@ -2,7 +2,7 @@ import markdownify
|
||||||
|
|
||||||
|
|
||||||
def write_to_file(article, header):
|
def write_to_file(article, header):
|
||||||
with open(str(article.title) + ".md", 'a') as f:
|
|
||||||
markdown = markdownify.markdownify(article.html, heading_style='ATX')
|
markdown = markdownify.markdownify(article.html, heading_style='ATX')
|
||||||
|
with open(str(article.title) + ".md", 'w') as f:
|
||||||
f.write(header)
|
f.write(header)
|
||||||
f.write(markdown)
|
f.write(markdown)
|
||||||
|
|
Loading…
Reference in New Issue