会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
KevinLU
首页
联系
Github
新随笔
博客园
管理
Kevin Lu
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
8
9
10
11
12
13
14
15
下一页
2014年7月2日
Python中map,filter,reduce,zip的应用
摘要: 事例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
阅读(835)
评论(0)
推荐(0)
2014年6月27日
python使用psutil获取服务器信息
摘要: >>> 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
阅读(2152)
评论(0)
推荐(0)
2014年6月26日
python编码encode和decode
摘要: 计算机里面,编码方法有很多种,英文的一般用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
阅读(18683)
评论(0)
推荐(1)
2014年6月24日
安装saltstack
摘要: 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
阅读(665)
评论(0)
推荐(0)
2014年6月18日
Python 多进程
摘要: 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
阅读(727)
评论(0)
推荐(0)
2014年5月27日
Nginx+uWSGI+bottle 在Linux上部署
摘要: 在/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
阅读(2701)
评论(0)
推荐(0)
2014年5月26日
使用imp加载python模块
摘要: 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
阅读(8569)
评论(0)
推荐(0)
2014年5月21日
python中functools.wraps装饰器的作用
摘要: functools.wraps装饰器用于显示被包裹的函数的名称import functoolsdef node(func): #@functools.wraps(func) def wrapped(*args, **kwargs): print "print from no...
阅读全文
posted @ 2014-05-21 11:25 Xjng
阅读(1228)
评论(0)
推荐(0)
linux awk命令学习
摘要: 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
阅读(858)
评论(0)
推荐(0)
linux sed命令学习
摘要: 1. Sed简介2. 定址3. Sed命令4. 选项5. 元字符集6. 实例7. 脚本8. 小技巧1. Sed简介sed是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓...
阅读全文
posted @ 2014-05-21 10:31 Xjng
阅读(845)
评论(0)
推荐(0)
上一页
1
···
8
9
10
11
12
13
14
15
下一页
公告