From 5bbf6b4a72fab5dc13a852b891a28c7d0f3ec28b Mon Sep 17 00:00:00 2001 From: Kale Date: Tue, 17 Aug 2021 22:15:39 -0700 Subject: [PATCH] Update 'crawler.py' --- crawler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crawler.py b/crawler.py index 9605219..052eee3 100644 --- a/crawler.py +++ b/crawler.py @@ -75,6 +75,11 @@ def filteringcon(filters_regex_one): if not line.endswith((tuple(remove_words))): f.write('\n'.join([line + '\n'])) f.close() + with open(filters_regex_one, 'r') as f: + lines = f.read().splitlines() + with open(filters_regex_one, 'w') as f: + for line in lines: + f.write('\n'.join(line.split()) def killingdup(duplicated_file): print('Getting rid of duplicated line')