码迷,mamicode.com
首页 >  
搜索关键字:threading    ( 3244个结果
python多线程之threading、ThreadPoolExecutor.map
背景: 某个应用场景需要从数据库中取出几十万的数据时,需要对每个数据进行相应的操作。逐个数据处理过慢,于是考虑对数据进行分段线程处理: 方法一:使用threading模块 代码: 1 # -*- coding: utf-8 -*- 2 import math 3 import random 4 im ...
分类:编程语言   时间:2019-12-12 10:25:32    阅读次数:145
Ajax简单应用之个人简历页面搭建
1.搭建HTTP静态Web服务器。 代码实现: 1 # 1.导入socket模块 2 import socket 3 import threading 4 5 6 # 创建服务器类 7 class HttpServerSocket(object): 8 # 给服务器类的对象设置属性 9 def __ ...
分类:Web程序   时间:2019-12-12 01:36:27    阅读次数:125
Log 帮助类 队列
队列形式 1 using System; 2 using System.Collections; 3 using System.IO; 4 using System.Text; 5 using System.Threading; 6 using System.Windows.Threading; 7 ...
分类:其他好文   时间:2019-12-11 12:37:15    阅读次数:99
A*算法【拼图游戏】
数据结构 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 拼图 { /// <summary> ...
分类:编程语言   时间:2019-12-09 23:15:11    阅读次数:171
Python之HTTP静态服务器-面向对象版开发
1 # 1.导入socket模块 2 import socket 3 # import gevent 4 import threading 5 6 7 # 创建服务器类 8 class HttpServerSocket(object): 9 # 给服务器类的对象设置属性 10 def __init_ ...
分类:编程语言   时间:2019-12-08 23:47:22    阅读次数:186
python实现建立websocket通信
实现代码如下: #websocket协议通信 import threading import time import websocket def when_message(ws, message): print('/n接收到的消息:' + message) # 当建立连接后,死循环不断输入消息发送给 ...
分类:编程语言   时间:2019-12-08 14:07:23    阅读次数:248
Python的socket聊天脚本。
没有前端,多开了一条线程用于接收信息。 服务器端: # -*- coding:utf-8 -*- import socket import threading class Sock_Server: def __init__(self): self.host = '192.168.1.11' # 获取 ...
分类:编程语言   时间:2019-12-08 01:11:09    阅读次数:69
python线程池示例
使用with方式创建线程池,任务执行完毕之后,会自动关闭资源 , 否则就需要手动关闭线程池资源 import threading, time from concurrent.futures import ThreadPoolExecutor, as_completed class MyTask(th ...
分类:编程语言   时间:2019-12-07 21:03:58    阅读次数:73
C# 避免程序重复启动
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Threading; namespace WindowsFormsApplicati ...
分类:Windows程序   时间:2019-12-07 12:35:03    阅读次数:116
多线程爬取笔趣阁免费小说全站爬取
import threading,os,time,requests,pymongo,refrom queue import Queuefrom lxml import etreefrom bs4 import BeautifulSoup as BPclient = pymongo.MongoClie ...
分类:编程语言   时间:2019-12-06 11:40:39    阅读次数:184
3244条   上一页 1 ... 32 33 34 35 36 ... 325 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!