易截截图软件、单文件、免安装、纯绿色、仅160KB

Python:FriendFeed的Tornado Web Server

代码很简单,不到5k行。但是思路挺好的,改成non-blocking了之后效率就是能提高不少,特别是考虑到现代的web app都需要和其他的
HTTP服务器通信,blocking的代价太大了。 Tornado is an open source version of the scalable, non-blocking web server and tools that power FriendFeed. The FriendFeed application is written using a web framework that looks a bit like web.py or Google's webapp, but with additional tools and optimizations to take advantage of the underlying non-blocking infrastructure.
The framework is distinct from most mainstream web server frameworks (and certainly most Python frameworks) because it is non-blocking and reasonably fast. Because it is non-blocking and uses epoll, it can handle thousands of simultaneous standing connections, which means it is ideal for real-time web services. We built the web server specifically to handle FriendFeed's real-time features — every active user of FriendFeed maintains an open connection to the FriendFeed servers. (For more information on scaling servers to support thousands of clients, see The C10K problem.)
See the Tornado documentation for a detailed walkthrough of the framework. Tornado: Facebook Releases Python Framework as Open Source http://www.linux-magazine.com/Online/News/Tornado-Facebook-Releases-Python-Framework-as-Open-Source


相关文档:

python 多继承

 from: http://www.cnblogs.com/dahuzizyd/archive/2005/03/01/111006.html
python支持面向对象的编程风格,这里主要说说python中的多继承:
下面的代码使用python2.4,安装后使用idle的IDE开发环境(说是IDE ,比起delphi,VS.net等简单得太多了)
从File-New菜单建立一个.py文件,写下面的代码:
class SuperCl ......

python中使用方便的LIST对象

最近对python产生了兴趣,于是从网上下载了基本PYTHON的书和文档,开始了PYTHON的学习,发现PYTHON中的list对象的功能实在是非常强大,编程起来比其他的程序语言对列表的操作要方便的多。
在python中定义一个列表只需要如下语句
li = ["a","b","c","d"]
list有许多的函数可以用来进行对列表的操作,如extend,append,inse ......

python使用SocketServers


python使用SocketServers
SocketServers模块为一组socket服务类定义了一个基类,这组类压缩和隐藏了监听、接受和处理进入的socket连接的细节。
1、SocketServers家族
TCPServer和UDPServer都是SocketServer的子类,它们分别处理TCP和UDP信息。
注意:SocketServer也提供UnixStreamServer(TCPServer的子类)和UNIXdatag ......

实战构建Python和C++混合系统

      关于C++和Python之间互相调用的问题,可以查找到很多资料。本文将主要从解决实际问题的角度看如何构建一个Python和C++混合系统。
                       &nbs ......

Python代码优化

Python代码优化--少打字小技巧
说明:增加代码的描述力,可以成倍减少你的LOC,做到简单,并且真切有力
观点:少打字=多思考+少出错,10代码行比50行更能让人明白,以下技巧有助于提高5倍工作效率
1. 交换变量值时避免使用临时变量:(cookbook1.1)
老代码:我们经常很熟练于下面的代码
temp = x
x = y
y = ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号