From 7c6893cae42cdcd21ced06c670d67010307a08d4 Mon Sep 17 00:00:00 2001 From: minoplhy Date: Wed, 11 Aug 2021 00:23:40 +0700 Subject: [PATCH] Clear Blank Space after merged file in add_file module --- excluder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/excluder.py b/excluder.py index e758c3e..b32e7cc 100644 --- a/excluder.py +++ b/excluder.py @@ -25,6 +25,12 @@ def add_file(incoming,excluded_in): lines = set(f.readlines()) with open(incoming, 'w') as f: f.writelines(set(lines)) + with open(incoming ,'r') as f: + lines = f.read().split() + with open(incoming ,'w') as f: + for line in lines: + if line.strip(): + f.write('\n'.join([line + '\n'])) crawler.sort(incoming) os.remove(excluded_in)