本文实例讲述了Python实现base64编码的图片保存到本地功能。分享给大家供大家参考,具体如下:
# -*- coding:utf-8 -*-
#!python3
import os
import base64
sss =”””/9j/4AAQSkZJRgABAQEASABIAAD//gAyUHJvY2Vzc2VkIEJ5IGVCYXkgd2l0aCBJbWFnZU1hZ2ljaywgejEuMS4wLiB8fEIy/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxobIxwWFiAsICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo/8AAEQgC6wPoAwEiAAIRAQMRAf/EAB0AAAIBBQEBAAAAAAAAAAAAAAABAgMEBgcIBQn/xABWEAABAwIDBQQGBgUHCAkEAwEBAAIDBBEFITEGEkFRYQcTcYEiMpGhsfAIFELB0eEVIzNSYhYkcpKTsvEXNDVDU3OCoiU2RFRVdMLS4iY3RWMnZIOj/8QAGwEBAQEAAwEBAAAAAAAAAAAAAAECAwQFBgf/xAA3EQEBAAICAQMDAQYDCAMBAQAAAQIRAwQhBRIxBkFRExQiMjNhcYGx8BUWIzRSocHRNVNyQpH/2gAMAwEAAhEDEQA/AN/WAzBAIz6N8EX0FiLZgX06+CL24aZgfu9fBGXXnYfOi43Ki45HM8zbU+HRQPMgAjiOHgpki3AW4jh4JOGfK2YA0b1Us8rtDoBa2duXVAFhr16nr4JnlbrYcevgl1NjzLePglTYdz9tuHgkTbgAW55aN6oAzuCGgZ3Ge71CC0