时间:2021-07-01 10:21:17 帮助过:171人阅读
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)