上一页 1 ··· 8 9 10 11 12 13 14 15 下一页
摘要: 事例1:l=[('main', 'router_115.236.xx.xx', [{'abc': 1}, {'dfg': 1}]), ('main', 'router_183.61.xx.xx', [{'abc': 0}, {'dfg': 1}]), ('main', 'router_5... 阅读全文
posted @ 2014-07-02 18:12 Xjng 阅读(822) 评论(0) 推荐(0) 编辑
摘要: >>> import psutil获取cpu信息>>> psutil.cpu_times()scputimes(user=128258.38, nice=12.29, system=88369.31, idle=6713420.33, iowait=3290.63, irq=1069.04, sof... 阅读全文
posted @ 2014-06-27 11:24 Xjng 阅读(2142) 评论(0) 推荐(0) 编辑
摘要: 计算机里面,编码方法有很多种,英文的一般用ascii,而中文有unicode,utf-8,gbk,utf-16等等。unicode是 utf-8,gbk,utf-16这些的父编码,这些子编码都能转换成unicode编码,然后转化成子编码,例如utf8可以转成unicode,再转gbk,但不能直接从u... 阅读全文
posted @ 2014-06-26 11:59 Xjng 阅读(18624) 评论(0) 推荐(1) 编辑
摘要: 1.安装master安装epel源# cd /usr/local/src/# wget http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm# rpm -ivh epel-release-6-8.noarch... 阅读全文
posted @ 2014-06-24 14:22 Xjng 阅读(651) 评论(0) 推荐(0) 编辑
摘要: import threadingfrom time import sleepfrom msalt_proxy.client import Clientdef f(t): print t cli=Client(t,'*',role='server') cli.sys.ping()from mul... 阅读全文
posted @ 2014-06-18 16:52 Xjng 阅读(720) 评论(0) 推荐(0) 编辑
摘要: 在/data/lujianxing/bottle 文件夹中创建三个文件:bottle.py bottle的源文件a.pyfrom bottle import Bottle, runmybottle = Bottle()@mybottle.route('/')def index(): return ... 阅读全文
posted @ 2014-05-27 10:49 Xjng 阅读(2689) 评论(0) 推荐(0) 编辑
摘要: import impimport sysfn_, path, desc = imp.find_module('mymodule', ['/data/module/'])print fn_,path,descmod = imp.load_module(''mymodule'', fn_, path, ... 阅读全文
posted @ 2014-05-26 11:19 Xjng 阅读(8541) 评论(0) 推荐(0) 编辑
摘要: functools.wraps装饰器用于显示被包裹的函数的名称import functoolsdef node(func): #@functools.wraps(func) def wrapped(*args, **kwargs): print "print from no... 阅读全文
posted @ 2014-05-21 11:25 Xjng 阅读(1219) 评论(0) 推荐(0) 编辑
摘要: 3. awk的运行过程1) awk_script的组成:① awk_script可以由一条或多条awk_cmd组成,两条awk_cmd之间一般以NEWLINE分隔② awk_cmd由两部分组成: awk_pattern { actions }③ awk_script可以被分成多行书写,必须确保整个a... 阅读全文
posted @ 2014-05-21 11:11 Xjng 阅读(843) 评论(0) 推荐(0) 编辑
摘要: 1. Sed简介2. 定址3. Sed命令4. 选项5. 元字符集6. 实例7. 脚本8. 小技巧1. Sed简介sed是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓... 阅读全文
posted @ 2014-05-21 10:31 Xjng 阅读(830) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 下一页