在 面向对象程式设计里, 责任链模式是一种软件设计模式,它包含了一些命令对象和一系列的处理对象。每一个处理对象决定它能处理哪些命令对象,它也知道如何将它不能处理的命令对象传递给该链中的下一个处理对象。该模式还描述了往该处理链的末尾添加新的处理对象的方法。模式定义:职责链模式(Chain of Respo...【阅读全文】
import sys;sys.setrecursionlimit(1500);但是,执行完sys.setrecursionlimit(1500);后,测试发现实际递归值会比设定值小20。难道是python运行就使用了20次递归?不明白。测试代码如下:import syssys.setrecursionlimit(1500) # set the maximum depth as 1500 def recursion(n): &nb...【阅读全文】
vimviews.pyfrom django.shortcuts importrender_to_responsefrom django.http import HttpResponsefrom django import forms from sshCMD.models import SerInfo import paramikoimport os,sysimport re class SerForm(forms.Form):  ...【阅读全文】
Eventlet一直在研究openstack的代码,发现eventlet是openstack project中很重要的一个module,因此觉得很有必要把它详细的总结一下,好容易明白一些很magic的功能如何实现的,更加体现了python的简洁。首先需要明白的是eventlet究竟是什么?官网是如下描述的:Eventlet is a concurrent networking library for P...【阅读全文】
报错信息如下:点击(此处)折叠或打开python: error while loading shared libraries: libpython2.6.so.1.0: cannot open shared object file: No such file or directoryllibpython2.6.so是PYTHON在运行时需要用到的组件,在加载其它扩展模块、运行...【阅读全文】