随笔- 454
文章- 302
评论- 28
阅读-
65万
文章分类 - python
python进程池高级版本
摘要:C:\Python31\python.exe D:/pythoncode/a8.py 1 0 2 4 3 7 6 6 5 9 8 10 11 12 13 14 15 18 16 17 19 5 0 5 0 20 21 20 24 23 22 25 26 29 29 28 29 28 27 30 31
阅读全文
python多线程low版本
摘要:#!/usr/bin/env python# -*- coding: utf-8 -*-import queueimport threadingclass threadpool(): def __init__(self,max_num): self.q = queue.Queue(max_num) for i in range(max_num): ...
阅读全文
python中上下文管理with用法
摘要:C:\Python31\python.exe D:/pythoncode/a6.py[1][]Process finished with exit code 0 C:\Python31\python.exe D:/pythoncode/a7.py123456789Process finished w
阅读全文
WebSocket详解
摘要:WebSocket协议是基于TCP的一种新的协议。WebSocket最初在HTML5规范中被引用为TCP连接,作为基于TCP的套接字API的占位符。它实现了浏览器与服务器全双工(full-duplex)通信。其本质是保持TCP连接,在浏览器和服务端通过Socket进行通信。 本文将使用Python编
阅读全文
自定义scrapy框架low版
摘要:from twisted.internet import reactor # 事件循环(终止条件,所有的socket都已经移除) from twisted.web.client import getPage # socket对象(如果下载完成,自动从时间循环中移除...) from twisted.internet import defer # defer.Deferred 特殊的s...
阅读全文
自定义scrapy框架前戏
摘要:from twisted.internet import reactor # 事件循环(终止条件,所有的socket都已经移除) from twisted.web.client import getPage # socket对象(如果下载完成,自动从事件循环中移除...) from twisted.internet import defer # defer.Deferred 特殊的s...
阅读全文