导航

上一页 1 2 3 4 5 6 7 ··· 37 下一页

2016年8月12日

摘要: 例如: 从数据库里读出了blob类型,如 z = b'61736467' 在py里转化成字符串:bytes.fromhex(z).decode('utf8') 阅读全文

posted @ 2016-08-12 15:03 网名还没想好 阅读(4214) 评论(0) 推荐(0) 编辑

2016年8月10日

摘要: 转载自http://weipengfei.blog.51cto.com/1511707/1215042 Redis本身是一个cs模式的tcp server, client可以通过一个socket连续发起多个请求命令。 每个请求命令发出后client通常会阻塞并等待redis服务端处理,redis服务 阅读全文

posted @ 2016-08-10 14:30 网名还没想好 阅读(729) 评论(0) 推荐(0) 编辑

摘要: def add_error_handler(app): for exception in default_exceptions: app.register_error_handler(exception, error_handler) app.register_error_handler(Exception, error_handler) def error_h... 阅读全文

posted @ 2016-08-10 10:49 网名还没想好 阅读(864) 评论(0) 推荐(0) 编辑

2016年8月9日

摘要: 转自http://get.ftqq.com/523.get 一、redis 数据结构使用场景 原来看过 redisbook 这本书,对 redis 的基本功能都已经熟悉了,从上周开始看 redis 的源码。目前目标是吃透 redis 的数据结构。我们都知道,在 redis 中一共有5种数据结构,那每 阅读全文

posted @ 2016-08-09 17:24 网名还没想好 阅读(191) 评论(0) 推荐(0) 编辑

摘要: 转自:http://www.binss.me/blog/analyse-the-implement-of-coroutine-in-tornado/ 什么是协程 以下是Wiki的定义: Coroutines are computer program components that generaliz 阅读全文

posted @ 2016-08-09 15:30 网名还没想好 阅读(526) 评论(0) 推荐(0) 编辑

2016年8月5日

摘要: 转自:http://blog.rainy.im/2016/03/10/how-the-heck-does-async-await-work-in-python-3-5/ [译] Python 3.5 协程究竟是个啥 Yushneng · Mar 10th, 2016 原文链接 : How the h 阅读全文

posted @ 2016-08-05 17:49 网名还没想好 阅读(314) 评论(0) 推荐(0) 编辑

2016年7月26日

摘要: 转自 http://www.cnblogs.com/rubylouvre/archive/2011/06/22/2086644.html Python内建异常体系结构 BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorEx 阅读全文

posted @ 2016-07-26 18:11 网名还没想好 阅读(228) 评论(0) 推荐(0) 编辑

摘要: import logging from logging.handlers import RotatingFileHandler from flask import Flask app = Flask(__name__) @app.route('/') def foo(): app.logger.warning('A warning occurred (%d apples)', 42... 阅读全文

posted @ 2016-07-26 17:01 网名还没想好 阅读(306) 评论(0) 推荐(0) 编辑

2016年7月16日

摘要: 译者:xidui原文: http://sahandsaba.com/understanding-asyncio-node-js-python-3-4.html 译者前言 如何用yield以及多路复用机制实现一个基于协程的异步事件框架? 现有的组件中yield from是如何工作的,值又是如何被传入y 阅读全文

posted @ 2016-07-16 23:11 网名还没想好 阅读(1320) 评论(1) 推荐(0) 编辑

2016年7月11日

摘要: class TestCase(unittest.TestCase): session = None def setUp(self): self.app = create_app() self.app.testing = True ################################### 阅读全文

posted @ 2016-07-11 16:46 网名还没想好 阅读(625) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 37 下一页