From f8a531b90587c06b07754a92d6463a077021839d Mon Sep 17 00:00:00 2001 From: ccl Date: Tue, 8 Dec 2020 23:45:30 +0100 Subject: [PATCH] added escaped newlines in the string --- api.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/api.py b/api.py index 19bb95c..cb62afa 100644 --- a/api.py +++ b/api.py @@ -119,20 +119,22 @@ def api_args(): if 'rq' in request.args: rqstr = str(request.args['rq']) if rqstr == "generate": - # Create an empty list for our results - results = [] - api_phrase = [] + + api_phrase_str = '' for i in range(len(seedTextList)): # Current word in the seed phrase current = seedTextList[i] # Going through the letters in the above word + api_phrase = [] for y in range(len(current)): testKey = str(y) + current[y] # print(current[y],random.choice(toChooseFrom[testKey])) api_phrase.append(random.choice(toChooseFrom[testKey])) - api_phrase_str = ' \n '.join(api_phrase) - results.append(api_phrase_str) - + api_phrase_str_word = ' '.join(api_phrase) + api_phrase_str = api_phrase_str + '\\n' + api_phrase_str_word + api_phrase_str_word = '' + api_phrase_str = api_phrase_str[2:] + print(api_phrase_str) for elem in refWords: if elem in api_phrase: count +=1