From 93340fb3f45b7ea0f19303adaab07f8456e082a5 Mon Sep 17 00:00:00 2001 From: Dmytro Yeroshkin Date: Fri, 22 Oct 2021 15:37:18 +0200 Subject: [PATCH] moved mdfile.close() --- novel_stats/novel_stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/novel_stats/novel_stats.py b/novel_stats/novel_stats.py index 326df3c..9b88db4 100755 --- a/novel_stats/novel_stats.py +++ b/novel_stats/novel_stats.py @@ -78,6 +78,8 @@ def main(): word_count_by_status[current_status] += line_word_count status_by_chapter[chapter_heading][current_status] += line_word_count + mdfile.close() + # Do some final accounting after the last chapter. word_count_by_act[act_heading] += word_count_by_chapter[chapter_heading] total_word_count += word_count_by_chapter[chapter_heading] @@ -114,8 +116,6 @@ def main(): print(f'{status}: {status_word_count:,} words (~{status_word_count * 100 // total_word_count}%)') print(f'total: {total_word_count:,} words') - - mdfile.close() if __name__ == '__main__':