python
Davenny
O ever youthful,O ever weeping.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
multiprocessing_Manager().Queue()_Pool
This code is to realize copy multiple files in one file to the other file by Pool in multiprocessing ,to reduce the time.import timefrom multiprocessing import Pool,Managerimport osdef copyFileTask(原创 2017-09-22 22:39:39 · 3665 阅读 · 1 评论 -
async in multiprocess_pool
from multiprocessing import Poolimport timeimport osdef test(): print('---the process in pool---pid = %d,ppid = %d---'%(os.getpid(),os.getppid())) for i in range(3): print('---%d -- '原创 2017-09-25 21:27:44 · 398 阅读 · 0 评论 -
udp_socket with thread to contect with each other
from threading import Threadfrom socket import *def sendinfo(): while True: sendinfo = input('<<') udpSocket.sendto(sendinfo.encode('utf-8'),adress)def recvinfo(): while True:原创 2017-09-27 17:57:23 · 528 阅读 · 0 评论 -
TCP_client and server in py
The client:from socket import *clientscoket = socket(AF_INET,SOCK_STREAM)clientscoket.bind(("",4568))clientscoket.connect(("your IP",port))clientscoket.send(b"hahha")recvData = clientscoket.recv(10原创 2017-09-28 15:03:30 · 412 阅读 · 0 评论 -
Different types Server in Python
multiprocess(The almost same as threading)from socket import *from multiprocessing import *from time import sleepdef dealWithClient(newsocket,cAddr): while True: recvData = newsocket.recv转载 2017-10-01 17:52:11 · 547 阅读 · 0 评论 -
Web static server
from socket import *from multiprocessing import Processimport redef fun(client_socket): documentRoot = './Html' client_data = client_socket.recv(1024) client_data_lines = client_data.split原创 2017-10-03 15:40:35 · 531 阅读 · 0 评论 -
simple dynamic web server with self defined framework (python)
The framework import timefrom test1 import HTTPServerclass Applicatoin(object): def __init__(self,urls): self.urls = urls def __call__(self, evn, start_response): path = evn.get原创 2017-10-05 23:09:32 · 470 阅读 · 0 评论
分享