Skip to content

Instantly share code, notes, and snippets.

@pruidong
Created September 26, 2021 07:03
Show Gist options
  • Save pruidong/89a39ec954242e946ab87c9c92eb7171 to your computer and use it in GitHub Desktop.
Save pruidong/89a39ec954242e946ab87c9c92eb7171 to your computer and use it in GitHub Desktop.
Python处理Base64字符串转为图片
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