From 0f1d7247c9079d7a16d028172fd72c6aa74fb376 Mon Sep 17 00:00:00 2001 From: Alireza Ghasemi Date: Mon, 28 Dec 2020 21:11:19 +0100 Subject: [PATCH] Use f-strings Maybe it's less verbose using newer versions of Python --- dash_b64_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dash_b64_image.py b/dash_b64_image.py index 4773b9b..c34e8a2 100644 --- a/dash_b64_image.py +++ b/dash_b64_image.py @@ -7,7 +7,7 @@ encoded_image = base64.b64encode(open('dash_app.png', 'rb').read()) app.layout = html.Div([ - html.Img(src='data:image/png;base64,{}'.format(encoded_image)) + html.Img(src=f'data:image/png;base64,{encoded_image}') ]) if __name__ == '__main__':