Created
September 26, 2021 07:03
-
-
Save pruidong/89a39ec954242e946ab87c9c92eb7171 to your computer and use it in GitHub Desktop.
Python处理Base64字符串转为图片
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
imgdata = base64.b64decode('base64str') | |
filename = 'base64decode.jpeg' | |
with open(filename, 'wb') as f: | |
f.write(imgdata) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment