Copy Code code as follows:
#!/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)
PS: Here again for you to recommend several online picture Tools for everyone to use the reference
Picture converted to BASE64 encoded online tool:
Http://tools.jb51.net/transcoding/img2base64
Online Email Email icon Production tool:
Http://tools.jb51.net/email/emaillogo
Online PS image processing tools:
http://tools.jb51.net/aideddesign/webps
Online picture format conversion (jpg/bmp/gif/png) Tool:
Http://tools.jb51.net/aideddesign/picext
ico icon Online generation tool:
http://tools.jb51.net/aideddesign/ico_img