- 浏览: 573366 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (181)
- python (48)
- django (35)
- 数据库 (22)
- openfire (5)
- 技术.生活 (7)
- Linux (17)
- 管理工具 (7)
- opencv (4)
- wxpython (2)
- solr (1)
- LDAP (1)
- CAS (3)
- Plone (5)
- OpenERP (19)
- Pinax (1)
- satchmo (0)
- Svn (3)
- Review Board (1)
- MangoDB (3)
- Nginx (8)
- Trac (1)
- Squid (3)
- XenServer (3)
- Nagios (7)
- SSH (2)
- XML-RPC (1)
- Redis (1)
- docker (3)
最新评论
-
gonglil:
为什么我的会出现无法连接到服务器,我看了报的错误是rfb.js ...
NoVNC的使用之一: 让我们把NoVNC代理跑起来 -
u012339746:
博主能给下demo么,求联系方式,急用
django多网站用户统一认证方案:django-simple-sso -
meylovezn:
凡是pdf的网址都失效了呢,不知道现在该去哪里照你说的那 ...
OE部分技术资料 -
meylovezn:
很不错的分享呢\(^o^)/~
OpenERP预定义对象方法 -
ihitu:
opencv-几个简单用法
#zz from http://www.exonsoft.com/~kochin/TinyP2P/tinyp2p.html # tinyp2p.py 1.0 (documentation at http://freedom-to-tinker.com/tinyp2p.html) # (C) 2004, E.W. Felten # license: http://creativecommons.org/licenses/by-nc-sa/2.0 # Annotated by Kochin Chang, Jan. 2005 # Usage: # Server - python tinyp2p.py password server hostname portnum [otherurl] # Client - python tinyp2p.py password client serverurl pattern # ar[0] ar[1] ar[2] ar[3] ar[4] ar[5] import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac # Import libraries used in the program. # sys : system variables and functions. # os : portable OS dependent functionalities. # SimpleXMLRPCServer : basic XML-RPC server framework. # xmlrpclib : XML-RPC client support. # re : regular expression support. # hmac : RFC 2104 Keyed-Hashing Message Authentication. ar,pw,res = (sys.argv,lambda u:hmac.new(sys.argv[1],u).hexdigest(),re.search) # A multiple assignment. # ar <- sys.argv : the argument list. # pw <- lambda u:hmac.new(sys.argv[1],u).hexdigest() : # a function makes an HMAC digest from a URL. # INPUT: a string, u, which is a URL here. # OUTPUT: a hexdecimal HMAC digest. # DESCRIPTION: # 1. Creates a HMAC object from the URL using network's password, # sys.argv[1], as the key. # 2. Returns a hexdecimal digest of the HMAC object. # res <- re.search : alias for the regular expression search function. pxy,xs = (xmlrpclib.ServerProxy,SimpleXMLRPCServer.SimpleXMLRPCServer) # A multiple assignment. # pxy <- xmlrpclib.ServerProxy : alias for the ServerProxy class. # xs <- SimpleXMLRPCServer.SimpleXMLRPCServer : alias for the SimpleXMLRPCServer class. def ls(p=""):return filter(lambda n:(p=="")or res(p,n),os.listdir(os.getcwd())) # a function lists directory entries. # INPUT: a string, p, which is a regular expression pattern. # OUTPUT: a list of directory entries matched the pattern. # DESCRIPTION: # 1. Creates a function using lambda expression that takes a pathname as its # parameter. The function returns true if the pattern is empty or the # pathname matches the pattern. # 2. Finds out what is the current working directory. # 3. Retrieves a list of directory entries of current working directory. # 4. Filters the list using the lambda function defined. if ar[2]!="client": # Running in server mode... myU,prs,srv = ("http://"+ar[3]+":"+ar[4], ar[5:],lambda x:x.serve_forever()) # A multiple assignment. # myU <- "http://"+ar[3]+":"+ar[4] : server's own URL. # prs <- ar[5:] : URL's of other servers in the network. # srv <- lambda x:x.serve_forever() : # a function to start a SimpleXMLRPCServer. # INPUT: a SimpleXMLRPCServer object, x. # OUTPUT: (none) # DESCRIPTION: # Calls the server's serve_forever() method to start handling request. def pr(x=[]): return ([(y in prs) or prs.append(y) for y in x] or 1) and prs # a function returns the server list. # INPUT: a list, x, of servers' URLs to be added to the server list. # OUTPUT: the updated server list. # DESCRIPTION: # 1. For each URL in x, checks whether it's already in the server list. # If it's not in the list, appends in onto the list. # 2. Returns the updated server list. def c(n): return ((lambda f: (f.read(), f.close()))(file(n)))[0] # a function returns content of the specified file. # INPUT: a string, n, which is a filename. # OUTPUT: the content of the file in a string. # DESCRIPTION: # 1. Creates a function using lambda expression that takes a file object, f, # as its parameter. The function reads the content of the file, then # closes it. The results of the read and close are put into a tuple, and # the tuple is returned. # 2. Creates a file object with the filename. Passes it to the lambda # function. # 3. Retrieves and returns the first item returned from the lambda function. f=lambda p,n,a:(p==pw(myU))and(((n==0)and pr(a))or((n==1)and [ls(a)])or c(a)) # a request handling function, depending on the mode, returns server list, # directory entries, or content of a file. # INPUT: a string, p, which is a hexdecimal HMAC digest. # a mode number, n. # if n is 0, a is a list of servers to be added to server list. # if n is 1, a is a pattern string. # if n is anything else, a is a filename. # OUTPUT: if n is 0, returns the server list. # if n is 1, returns directory entries match the pattern. # if n is anything else, returns content of the file. # DESCRIPTION: # 1. Verifies the password by comparing the HMAC digest received and the # one created itself. Continues only when they match. # 2. If n is 0, calls pr() to add list, a, and returns the result. # If n is 1, calls ls() to list entries match pattern a, and returns # the result enclosed in a list. # If n is any other value, retreives and return content of the file # with filename specified in a. def aug(u): return ((u==myU) and pr()) or pr(pxy(u).f(pw(u),0,pr([myU]))) # a function augments the network. # INPUT: a string, u, which is a URL. # OUTPUT: a list of URL's of servers in the network. # DESCRIPTION: # 1. If the URL, u, equals to my own URL, just returns the server list. # 2. Otherwise, creates a ServerProxy object for server u. Then calls its # request handling function f with a HMAC digest, mode 0, and server # list with myself added. # 3. Calls pr() with the result returned from server u to add them to my # own list. # 4. Returns the new list. pr() and [aug(s) for s in aug(pr()[0])] # 1. Checks the server list is not empty. # 2. Takes the first server on the list. Asks that server to augment its # server list with my URL. # 3. For each server on the returned list, asks it to add this server to its # list. (lambda sv:sv.register_function(f,"f") or srv(sv))(xs((ar[3],int(ar[4])))) # Starts request processing. # 1. Defines a function with lambda expression that takes a SimpleXMLRPCServer # object, registers request handling function, f, and starts the server. # 2. Creates a SimpleXMLRPCServer object using hostname (ar[3]) and portnum # (ar[4]). Then feeds the object to the lambda function. # Running in client mode... for url in pxy(ar[3]).f(pw(ar[3]),0,[]): # 1. Create a ServerProxy object using the serverurl (ar[3]). # 2. Calls the remote server and retrieves a server list. # 3. For each URL on the list, do the following: for fn in filter(lambda n:not n in ls(), (pxy(url).f(pw(url),1,ar[4]))[0]): # 1. Create a ServerProxy object using the URL. # 2. Calls the remote server to return a list of filenames matching the # pattern (ar[4]). # 3. For each filename doesn't exist locally, do the following: (lambda fi:fi.write(pxy(url).f(pw(url),2,fn)) or fi.close())(file(fn,"wc")) # 1. Define a lambda function that takes a file object, calls remote server # for the file content, then closes the file. # 2. Create a file object in write and binary mode with the filename. (I # think the mode "wc" should be "wb".) # 3. Passes the file object to the lambda function.
发表评论
-
sentry环境搭建( django )
2018-08-07 14:13 2073参考1: http://codingcrush.me/20 ... -
如何利用sphinx自动生成文档
2018-08-02 15:15 1701参考如下: 1. http://www.huangwen ... -
如何利用apidoc自动生成文档
2018-08-02 13:44 1798参考如下: 1. http://apidocjs.com ... -
python处理非utf8编码文件转为utf8
2015-12-08 13:41 32761 判断文件的编码 import chardet ... -
word文档转pdf
2015-11-04 09:49 776环境: ubuntu 14.04 + python2. ... -
apache2使用mpm_worker , php5不能使用的解决方法
2014-11-08 09:20 1917参考 : http://www.ehow ... -
Nginx + Uwsgi + django 部署
2014-12-05 11:54 12481. 安装 nginx 写道 sudo add-apt ... -
NoVNC的使用之二: 将Novnc整合进django项目
2014-09-28 15:38 2790上一篇已经讲了如 ... -
NoVNC的使用之一: 让我们把NoVNC代理跑起来
2014-09-25 18:10 19807写道 NoVNC 正是我们需要的 HTML5 VNC 客 ... -
python subprocess 小记
2014-08-21 11:35 9911. Python subprocess模块 2. 小心s ... -
用cherrypy来代替django的runserver
2014-06-05 16:01 1598django自带的runserver在开发环境时确实相 ... -
发送图片附件邮件
2014-03-14 14:10 966def sendMail(from_email, to_em ... -
python之soap(soaplib(server),suds(client))
2014-03-11 16:02 4334如何用python实现soap协议并搭建webservice ... -
python编程规范
2014-02-28 10:14 9655程序模板 @FileName: @Author:x ... -
django绝对域名的切换
2014-02-26 10:04 4406描述 为了SEO建设,试图将icgoo网站上的所有相对链接 ... -
django多数据库的实现
2014-02-26 09:57 3020参考文档: * https://docs.djan ... -
Django settings之完美设计
2014-02-26 09:53 1118起因 写道 settings文件是网站最为关键的配置文件 ... -
django RestFrameWork的简单测试
2014-02-26 09:47 9660描述 写道 在icgoo中添加restframework ... -
XML-RPC简单python实现
2014-02-25 11:19 1305将数据定义为xml格式,通过http协议进行远程传输 写道 ... -
用python访问SqlServer
2014-02-24 11:59 3796在ubuntu下用python访问windows200 ...
相关推荐
本项目是一款基于C语言核心的跨平台HTTP客户端/服务端软件库——soup的设计源码,包含372个文件...该库支持C、C、HTML、JavaScript、PHP、Shell、CSS和Python等多种语言,旨在提供高效、灵活的HTTP客户端和服务端功能。
- 基于TCP的简单聊天程序:服务端接收多个客户端连接,每个客户端可以发送消息给服务端,服务端广播消息给所有在线客户端。 - 文件传输应用:客户端请求服务端的文件,服务端读取文件并分块发送,客户端接收并拼接...
在Python3中,进行HTTP服务端与客户端的通信是网络编程的一个重要方面。HTTP(超文本传输协议)是互联网上应用最广泛的一种网络协议,用于从万维网服务器传输超文本到本地浏览器的传输协议。Python3提供了丰富的库来...
本项目包含客户端(Client.py)和服务端(Server.py),适用于初学者掌握基础的网络编程技能。我们将深入探讨这两个核心文件以及相关知识点。 首先,我们要了解Python中的网络编程。在Python中,socket模块提供了低...
本文实例讲述了Python 网络编程之TCP客户端/服务端功能。分享给大家供大家参考,具体如下: demo.py(TCP客户端): import socket def main(): # 1. 创建tcp的套接字 tcp_socket = socket.socket(socket.AF_INET...
基于PyQt5的TCP文件传输程序python源码(含客户端+服务端).zip基于PyQt5的TCP文件传输程序python源码(含客户端+服务端).zip基于PyQt5的TCP文件传输程序python源码(含客户端+服务端).zip基于PyQt5的TCP文件传输程序...
基于UDP协议开发的即时聊天室python源码(含客户端+服务端).zip基于UDP协议开发的即时聊天室python源码(含客户端+服务端).zip基于UDP协议开发的即时聊天室python源码(含客户端+服务端).zip基于UDP协议开发的即时聊天...
本篇将深入探讨如何使用Python实现TCP(传输控制协议)通信,包括客户端和服务端的构建,并结合图形用户界面(GUI)提升用户体验。 TCP是一种面向连接的、可靠的、基于字节流的传输层通信协议,确保数据的顺序传输...
标题中的“ice客户端和服务端”指的是ZeroC的ICE(Internet Communications Engine)框架,这是一个高性能、跨平台的中间件,用于构建分布式系统。ICE提供了一种面向对象的接口,支持多种编程语言,包括C++、Java、...
客户端和服务端源代码是软件开发中的核心组成部分,它们构成了应用程序的两大部分,使得用户能够通过网络进行交互。在这个特定的压缩包中,虽然文件名为"TEST",但我们可以通过理解客户端和服务端的基本概念来深入...
Python 模拟http服务端, 客户端
在Python中使用Socket实现TCP服务端和客户端的基本步骤如下: ### TCP服务端操作 1. **创建Socket**: 使用`socket.socket()`函数创建Socket对象,参数默认为`socket.AF_INET`(IPv4)和`socket.SOCK_STREAM`...
基于python+pyqt5开发的拍卖行程序源码(含客户端和服务端)+项目说明.zip基于python+pyqt5开发的拍卖行程序源码(含客户端和服务端)+项目说明.zip基于python+pyqt5开发的拍卖行程序源码(含客户端和服务端)+项目说明....
在压缩包中的"TCP客户端和服务端代码"可能包含了具体的实现细节,包括但不限于上述步骤。通过学习和分析这些代码,我们可以更好地理解TCP通信的工作原理,并将这些知识应用于实际项目中。无论是开发服务器端应用还是...
在 Redis 的架构中,客户端(Client)和服务端(Server)是两个关键组件,它们之间的交互构成了 Redis 数据操作的基础。 **Redis 客户端** Redis 客户端是应用程序与 Redis 服务器进行通信的接口。它负责建立连接...
斗地主服务端源码是开发在线斗地主游戏的核心部分,它负责处理游戏逻辑、玩家交互、数据存储以及网络通信等关键任务。本源码包含客户端程序,提供了一个完整的系统,供开发者学习和研究。涉及到的主要编程语言有Lua...
基于python+opencv人脸识别的签到管理系统源码带界面+演示视频+设计报告(含客户端+服务端).zip基于python+opencv人脸识别的签到管理系统源码带界面+演示视频+设计报告(含客户端+服务端).zip基于python+opencv...
标题中的"python socket实现客户端服务端通信列子"指的就是使用Python的socket库来创建一个客户端(client)和一个服务器端(server),以便它们可以通过网络进行交互。这个过程通常包括以下几个步骤: 1. **创建...
在Android应用开发中,"客户端+服务端"的架构模式是常见的设计方式,它涉及到Android客户端与远程服务器之间的数据通信和交互。这种模式允许应用程序在本地执行用户界面操作,同时利用服务器的计算能力和存储资源来...