From 4d65c42884ba0c8fc6627e8c0f58825c388c9deb Mon Sep 17 00:00:00 2001 From: Francesco Luzzana Date: Tue, 31 May 2022 16:17:32 +0200 Subject: [PATCH] list comprehension for text output --- cookbook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook.py b/cookbook.py index fe7ae1b..2aa7854 100644 --- a/cookbook.py +++ b/cookbook.py @@ -87,7 +87,7 @@ def update_wiki(recipe): text = page.text() - steps = [f"# {log}" for log in recipe["logs"]].join('\n') + steps = '\n'.join([f"# {log}" for log in recipe["logs"]]) # PROV TEMPLATE content = f""" @@ -107,7 +107,7 @@ def update_wiki(recipe): """ # mi disp - text += [line.strip() for line in content.splitlines()].join('\n') + text += '\n'.join([line.strip() for line in content.splitlines()]) print(text)