python獲得圖片base64編碼示例
#!/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:這里再為大家推薦幾款在線圖片工具供大家參考使用
圖片轉換為Base64編碼在線工具:
http://tools.jb51.net/transcoding/img2base64
在線Email郵箱圖標制作工具:
http://tools.jb51.net/email/emaillogo
在線PS圖像處理工具:
http://tools.jb51.net/aideddesign/webps
在線圖片格式轉換(jpg/bmp/gif/png)工具:
http://tools.jb51.net/aideddesign/picext
ICO圖標在線生成工具:
http://tools.jb51.net/aideddesign/ico_img
相關文章
使用Python獲取愛奇藝電視劇彈幕數(shù)據(jù)的示例代碼
這篇文章主要介紹了用Python獲取愛奇藝電視劇彈幕數(shù)據(jù),本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-01-01關于ZeroMQ 三種模式python3實現(xiàn)方式
今天小編就為大家分享一篇關于ZeroMQ 三種模式python3實現(xiàn)方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-12-12Python實現(xiàn)讀取txt文件中的數(shù)據(jù)并繪制出圖形操作示例
這篇文章主要介紹了Python實現(xiàn)讀取txt文件中的數(shù)據(jù)并繪制出圖形操作,涉及Python文件讀取、數(shù)值運算及基于pylab庫的圖形繪制相關操作技巧,需要的朋友可以參考下2019-02-02