会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
naralv
博客园
首页
新随笔
联系
订阅
管理
2019年7月15日
Python线程池ThreadPoolExecutor源码分析
摘要: 环境 Windows7x64 python3.6 先看个例子: import time from concurrent.futures import ThreadPoolExecutor def foo(): print('enter at {} ...'.format(time.strftime(
阅读全文
posted @ 2019-07-15 18:28 naralv
阅读(1277)
评论(0)
推荐(1)
2019年7月8日
asyncio系列之sleep()实现
摘要: 环境 Windows7x64 python3.6 先来看个例子,模仿asyncio来自己实现的模拟耗时操作 例1 import types import select import time import socket import functools class Future: def __ini
阅读全文
posted @ 2019-07-08 22:38 naralv
阅读(6039)
评论(3)
推荐(1)
asyncio系列之事件调度的核心原理
摘要: 环境 Windows7x64 python3.6 先来看一下一个简单的例子 例1: async def foo(): print('enter foo ...') await bar() print('exit foo ...') async def bar(): print('enter bar
阅读全文
posted @ 2019-07-08 17:32 naralv
阅读(453)
评论(0)
推荐(0)
2019年7月7日
asyncio系列之原生协程
摘要: 环境 Windows7x64 python3.6 原生协程 原生协程是基于async关键字的 # 定义一个简单的原生协程cor async def cor(): print('enter cor') print('exit cor') print(type(cor)) # <class 'funct
阅读全文
posted @ 2019-07-07 03:26 naralv
阅读(416)
评论(0)
推荐(2)
2019年7月2日
Django系列之中间件加载原理
摘要: 环境 Windows7x64 python3.6 Django1.10 假设我们有如下中间件: setting.py文件 MIDDLEWARE = [ 'django.middleware.A', 'django.middleware.B', 'django.middleware.C', 'djan
阅读全文
posted @ 2019-07-02 19:28 naralv
阅读(291)
评论(0)
推荐(1)
2019年6月30日
Django系列之启动入口源码分析
摘要: 环境 Windows7x64 python3.6 Django1.10 manage.py是启动入口,在里面调用execute_from_command_line(sys.argv)方法 def execute_from_command_line(argv=None): """Run a Manag
阅读全文
posted @ 2019-06-30 17:23 naralv
阅读(330)
评论(0)
推荐(1)
公告