部分ssrpc.py代码分析 -- 服务端: 1 #!/usr/bin/python3 2 3 from xmlrpc.client import Fault, dumps, loads 4 import sys 5 from socketserver import ForkingMixIn 6 ....
分类:
编程语言 时间:
2014-07-16 18:14:43
阅读次数:
296
#encoding=utf-8import randomfrom copy import copy def directInsertSort(seq): """ 直接插入排序 """ size = len(seq) for i in range(1,size): t...
分类:
编程语言 时间:
2014-07-16 18:11:59
阅读次数:
255
Python的字典和JSON在表现形式上非常相似#这是Python中的一个字典 dic = { 'str': 'this is a string', 'list': [1, 2, 'a', 'b'], 'sub_dic': { 'sub_str': 'this is sub str', 'sub_l...
分类:
编程语言 时间:
2014-07-16 18:09:52
阅读次数:
301
import sys class Stats: def __init__(self, sequence): # sequence of numbers we will process # convert all items to floats for numeri...
分类:
编程语言 时间:
2014-07-16 18:06:48
阅读次数:
257
一 不需要登录的import urllib2content = urllib2.urlopen('http://XXXX').read() 二 使用代理import urllib2proxy_support = urllib2.ProxyHandler({'http':'http://XX.XX.....
分类:
编程语言 时间:
2014-07-16 17:58:39
阅读次数:
226
思路是这样的,我们从第一个字符开始向后依次找,直到找到一个断句的地方,使得当前获得的子串在dict中,若找到最后都没找到,那么就是False了。
在找到第一个后,接下来找下一个断句处,当然是从第一个断句处的下一个字符开始找连续的子串,但是这时与第一个就稍有不同,比如说word=‘ab’, dict={ 'a', ab', ...},在找到a后,接下来处理的是b,我们发现b不在dict中,但是我们...
分类:
编程语言 时间:
2014-07-16 17:09:39
阅读次数:
273
第五章 自定义模块
此前我们一直使用Ansible自带的模块,这已经给我们提供了很多很强的‘自带的电池’,但是如果你有一些特殊又复杂的任务,你可能会希望学习一下如何扩展Anisble。本章你将学习到以下主题:
在python或则bash中编写模块
使用你开发的自定义模块...
分类:
其他好文 时间:
2014-07-16 09:55:30
阅读次数:
375
详见https://github.com/captainwong/instant_markup...
分类:
编程语言 时间:
2014-07-16 09:34:59
阅读次数:
297
无书面授权,请勿转载
第五章 自定义模块
Using a module
Now that we have written our very first module for Ansible, we should give it a
go in a playbook. Ansible looks at several places for its modules: first it looks ...
分类:
其他好文 时间:
2014-07-16 09:14:31
阅读次数:
376
help(__import__)__import__(...) __import__(name, globals={}, locals={}, fromlist=[], level=-1) -> module 导入一个模块。 globals:决定上下文,不修改。 locals:当前未使用。 ...
分类:
编程语言 时间:
2014-07-16 00:48:27
阅读次数:
302