随笔分类 -  Python

未完成 rpc
摘要:from flask import Flaskfrom flask import requestfrom flask import jsonifyapp = Flask(__name__)@app.route('/api/v1/convert', methods=['POST'])def conve 阅读全文

posted @ 2017-02-23 13:19 Turb 阅读(81) 评论(0) 推荐(0)

python 数据包操作
摘要:spkt = '4C 44 00 12 01 01 00 A4 02 00 00 00 0C 5A 01 00 00 00 00 00 00 00 00 00 01 68'strBytes = spkt.split()pktBytes = [int(x,16) for x in strBytes]p 阅读全文

posted @ 2017-02-15 16:07 Turb 阅读(328) 评论(0) 推荐(0)

python 生成字体图片
摘要:#-*- coding:utf8 -*-from PIL import Image, ImageDraw, ImageFontimport codecs as csdef genFontImage(font, char): size = font.size image = Image.new('1' 阅读全文

posted @ 2017-02-14 16:41 Turb 阅读(4207) 评论(0) 推荐(0)

pip源配置
摘要:pip.conf [global] index-url = http://pypi.mirrors.ustc.edu.cn/simple/ trusted-host = pypi.mirrors.ustc.edu.cn trusted-host = pypi.mirrors.ustc.edu.cn 阅读全文

posted @ 2017-02-13 13:27 Turb 阅读(103) 评论(0) 推荐(0)

windows系统下scrapy环境搭建
摘要:安装python:python2.7,win32版本(兼容性好)。 Lxml(默认包里编译不过,这里直接下载编译完成的): http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml Openssl(默认运行scrapy出错): https://pypi.pyth 阅读全文

posted @ 2017-02-13 13:16 Turb 阅读(110) 评论(0) 推荐(0)

导航