From 51edbbaf702e21ce79938606e69b410d86fbb0cd Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Sat, 12 Feb 2022 11:29:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=88=B0base64=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/tests/img2base64.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/tests/img2base64.py b/bin/tests/img2base64.py index 25027ff..94c1255 100644 --- a/bin/tests/img2base64.py +++ b/bin/tests/img2base64.py @@ -3,4 +3,9 @@ # @Author: markushammered@gmail.com # @Development Tool: PyCharm # @Create Time: 2022/2/12 -# @File Name: img2base64.py \ No newline at end of file +# @File Name: img2base64.py + + +import base64 + +print(base64.b64encode(open('example.png', 'rb').read()).decode('utf-8')) \ No newline at end of file