复制代码 代码如下:
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)
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8