From f463bcbf23e76a8e5e0a2bbfb02bda64ca68be1b Mon Sep 17 00:00:00 2001 From: Cristina Cochior Date: Sun, 5 May 2019 01:56:05 +0200 Subject: [PATCH] generate_links works now --- generate_links.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/generate_links.py b/generate_links.py index 0658602..9d798bf 100644 --- a/generate_links.py +++ b/generate_links.py @@ -14,10 +14,7 @@ for path, subdirs, files in os.walk(path): with open(file, encoding='utf-8') as f: textfile = f.read() for word in wordlist_dict: - wordlinked = ""+word+"" - # wordlinked = re.escape(wordlinked) - print(wordlinked) - # word = re.escape(word) - print(word) - # textfile = re.sub(word, wordlinked, textfile) -# print(textfile) + word = re.escape(word) + textfile = re.sub(r"(?\1", textfile) + +print(textfile)