base64转图片

import base64
def base64_to_img(bstr, file_path):
    imgdata = base64.b64decode(bstr)
    file = open(file_path, 'wb')
    file.write(imgdata)
    file.close()

 

图片转base64

import base64

f = open(img_path, 'rb')
img = base64.b64encode(f.read())

 

相关文章:

  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
  • 2021-12-03
相关资源
相似解决方案