From 1fc6905e87d9e7d25fde60a67f2d5e575123c6ea Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 13 Sep 2020 00:21:42 +0200 Subject: Use f-string instead of + operator to concat strings Signed-off-by: Olivier Gayot --- swiftstory/Cards.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swiftstory/Cards.py b/swiftstory/Cards.py index 3d314c3..d570f87 100644 --- a/swiftstory/Cards.py +++ b/swiftstory/Cards.py @@ -5,12 +5,12 @@ class Cards: @staticmethod def get_white_cards(lang): ''' Read the file containing the white cards and return a list of cards ''' - with open('usr/share/swiftstory/lang/' + lang + '/cards/white.json', encoding='utf-8') as fh: + with open(f'usr/share/swiftstory/lang/{lang}/cards/white.json', encoding='utf-8') as fh: return json.load(fh) @staticmethod def get_black_cards(lang): ''' Read the file containing the black cards and return a list of cards ''' - with open('usr/share/swiftstory/lang/' + lang + '/cards/black.json', encoding='utf-8') as fh: + with open(f'usr/share/swiftstory/lang/{lang}/cards/black.json', encoding='utf-8') as fh: return json.load(fh) -- cgit v1.2.3