python
phenhorlin2
这个作者很懒,什么都没留下…
展开
-
教你用 python 制作一张五彩斑斓的黑
基本构想:在黑色背景中随机填充彩色像素点 主要流程: 先创建 512 x 512的画布,背景设为纯黑色 再在这个512x512 个像素点里按照1%的概率随机挑选像素点 m , 这个像素点 m 的颜色 从预设的7种颜色(赤橙黄绿青蓝紫)中随机挑选 安装用到的 python 库 pip install pillow 创建 RGBA 图像画布, 背景色设置为 纯黑色 from PIL ...原创 2019-12-12 16:20:07 · 14384 阅读 · 17 评论 -
httplib2 post 问题
h = httplib2.Http(".cache") body = {"proxy_id": t.imei, "uid": pk, "device": "O", "status": "", "start": "", "end": "", "cellphone": ""} tb = urlencode(body原创 2014-07-16 20:21:51 · 1312 阅读 · 0 评论 -
python 字符串截取
某个字符串为stmp="abcdef54321" 取前面5个stmp[:5] 取后面5个stmp[-5:] 从前面开始取,不包括最后两个stmp[:-2] 从第1个取到第2个stmp[0:2]原创 2014-06-20 09:44:32 · 488 阅读 · 0 评论 -
python 二维码识别扫描
python3centos7 上zbarlight 使用的问题yum install zbar zbar-develimport requests from PIL import Image import zbarlight pic = "https://butu2.oss-cn-beijing.aliyuncs.com/bank/20180714213736.png" img = Image....原创 2018-07-15 10:53:20 · 6269 阅读 · 0 评论