Archived
图片到base64编码的代码
This commit is contained in:
1 file changed
+6
-1
@@ -3,4 +3,9 @@
|
|||||||
# @Author: markushammered@gmail.com
|
# @Author: markushammered@gmail.com
|
||||||
# @Development Tool: PyCharm
|
# @Development Tool: PyCharm
|
||||||
# @Create Time: 2022/2/12
|
# @Create Time: 2022/2/12
|
||||||
# @File Name: img2base64.py
|
# @File Name: img2base64.py
|
||||||
|
|
||||||
|
|
||||||
|
import base64
|
||||||
|
|
||||||
|
print(base64.b64encode(open('example.png', 'rb').read()).decode('utf-8'))
|
||||||
Reference in New Issue
Block a user