Posted in Python onJanuary 16, 2014
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, base64 icon = open('ya.png','rb') iconData = icon.read() iconData = base64.b64encode(iconData) LIMIT = 60 liIcon = [] while True: sLimit = iconData[:LIMIT] iconData = iconData[LIMIT:] liIcon.append('\'%s\'' %sLimit) if len(sLimit) < LIMIT: break print os.linesep.join(liIcon)
python获得图片base64编码示例
- Author -
zxhpj声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@