From a8a565f1b5858c66dd582143116e805450d16e07 Mon Sep 17 00:00:00 2001 From: minoplhy Date: Sat, 7 Aug 2021 11:36:18 +0700 Subject: [PATCH] Fix excluded Line Problem --- excluder.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/excluder.py b/excluder.py index cef402c..86c3c93 100644 --- a/excluder.py +++ b/excluder.py @@ -13,9 +13,14 @@ def add(incoming,input): crawler.sort(incoming) def add_file(incoming,excluded_in): - with open(incoming, "wb") as outfile: - with open(excluded_in, "rb") as infile: - outfile.write(infile.read()) + data= "" + with open(incoming) as fp: + data = fp.read() + with open(excluded_in) as fp: + data2 = fp.read() + data += data2 + with open (incoming, 'w') as fp: + fp.write(data + '\n') with open(incoming, 'r') as f: lines = set(f.readlines()) with open(incoming, 'w') as f: