Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5001403
  • 博文数量: 921
  • 博客积分: 16037
  • 博客等级: 上将
  • 技术积分: 8469
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-05 02:08
文章分类

全部博文(921)

文章存档

2020年(1)

2019年(3)

2018年(3)

2017年(6)

2016年(47)

2015年(72)

2014年(25)

2013年(72)

2012年(125)

2011年(182)

2010年(42)

2009年(14)

2008年(85)

2007年(89)

2006年(155)

发布时间:2013-12-19 11:53:11

直接上代码:#! /usr/bin/env python#coding=utf-8#Python中有一个有趣的语法,只要定义类型的时候,实现__call__函数,这个类型就成为可调用的。#换句话说,我们可以把这个类的对象当作函数来使用,相当于重载了括号运算符。class A(object):.........【阅读全文】

阅读(1667) | 评论(0) | 转发(0)

发布时间:2013-12-19 11:34:57

#! /usr/bin/env python#coding=utf-8## 1 多适配一个简单的适配器只适配一个对象,但一个适配器可适配多个对象。如果一个适配器采用一个以上的对象,它被称为多适配器。from zope.interface import Interfacefrom z.........【阅读全文】

阅读(1317) | 评论(0) | 转发(0)

发布时间:2013-12-19 11:23:57

#! /usr/bin/env python#coding=utf-8###工具:可以对应设计模式中的单子模式##1序言#现在我们已经了解了接口、适配器以及组件注册表的概念。#有时注册一个并不适配任何东西的对象也是有用的。#比如数据库连接、XML解析器、返.........【阅读全文】

阅读(1576) | 评论(0) | 转发(0)

发布时间:2013-12-19 11:15:33

#! /usr/bin/env python#coding=utf-8###适配器from zope.component import adaptsfrom zope.interface import implements, Interface, Attributeclass IDesk(Interface):    """A frontdesk will regist.........【阅读全文】

阅读(1440) | 评论(0) | 转发(0)

发布时间:2013-12-18 19:42:34

 https://github.com/therve/twotp/PrequesitesIn this document, we'll assume that you have a basic knowledge of Twisted (how to create a client, how to create a server, what is the protocol/factory mechanism, what is a deferred), and of Erlang (what is a node, what is the EPMD, what are the.........【阅读全文】

阅读(2258) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册