
python
过去的我
这个作者很懒,什么都没留下…
展开
-
python urllib2模块
python urllib2模块urlopen()最常用的函数 urllib2.urlopen(url[, data[, timeout[, cafile[, capath[, cadefault[, context]]]]]) Open the URL url, which can be either a string or a Request object.他有几个参数比较重要的原创 2015-03-04 11:44:45 · 3377 阅读 · 0 评论 -
python re 里面match 和search的区别
python re 里面match 和search的区别原创 2015-11-04 13:34:14 · 5148 阅读 · 0 评论 -
python执行shell-subprocess模块
python执行shell-subprocess模块callretcode = subprocess.call([“ls”, “-l”]) call我感觉相当与os.popen,只能执行命令,看返回值。取不到命令输出。所以还是得用Popen,注意P大写。Popen基本用法: child1 = subprocess.Popen([“cat”,”/etc/passwd”],stdout=su原创 2015-03-02 15:27:15 · 998 阅读 · 0 评论 -
redis pipeline
redis 的pipeline效率还是超高的.原创 2016-03-16 15:07:11 · 802 阅读 · 0 评论 -
python ConfigParser模块
ConfigParser模块原创 2016-03-30 14:46:13 · 642 阅读 · 0 评论 -
使用redis加速ansible
use redis skip ansible gather information step.原创 2015-06-17 11:36:25 · 2584 阅读 · 0 评论 -
python atexit
atexit就是at exit 注册一些回调函数,程序退出时执行原创 2016-03-12 13:13:09 · 480 阅读 · 0 评论 -
django 发送邮件
不推荐用localhost自己架设邮件服务器发邮件,因为很大几率会被屏蔽。我们用第三方的邮件服务器,比如说腾讯的。原创 2016-05-25 11:48:44 · 568 阅读 · 0 评论 -
django form
django form原创 2015-08-25 13:05:12 · 783 阅读 · 0 评论 -
django static + apache mod_wsgi部署
0.基本配置原创 2016-05-16 16:46:15 · 446 阅读 · 0 评论 -
python 线程与进程
0. 计算100w随机数的和,分别用多进程和多线程,结果是在同样的环境下,多进程更能压榨每个cpu使用率,因为GIL的存在,所以python里面的多线程效率有瓶颈。原创 2016-05-30 11:27:01 · 411 阅读 · 0 评论 -
python 调试
主要用的pdb ,类似gdb那种,原创 2015-11-14 21:23:01 · 413 阅读 · 0 评论 -
django 两种创建模型实例的方法
django 两种创建模型实例的方法原创 2015-10-25 08:24:43 · 2185 阅读 · 0 评论 -
python datetime 转timestamp
python datetime 转timestampimport datetime原创 2015-11-04 23:23:21 · 754 阅读 · 0 评论 -
zabbix api调用
zabbix api调用api能干什么Zabbix API allows you to programmatically retrieve and modify the configuration of Zabbix and provides access to historical data. It is widely used to:Create new applications to w原创 2015-03-12 17:41:37 · 5129 阅读 · 0 评论 -
zabbix通过脚本发短信
zabbix通过脚本发短信原理和zabbix发邮件是一样的,都是在action里面配置,发短信的方式是通过调用短信公司的api来完成,当然网上有不少利用139邮箱来发的,这个其实算调用email的一种,这里复述的是调用script的方法。step编写发短信的脚本。加上可执行权限。administration-> medis types 里面create ,类型选script,填上你的脚本名称。原创 2015-03-14 09:04:39 · 8555 阅读 · 2 评论 -
sqlite python脚本
use python connect sqlite db原创 2015-06-19 13:40:14 · 692 阅读 · 0 评论 -
cx_Oracle
cx_Oracle的安装和简单使用。原创 2015-06-12 09:50:29 · 1382 阅读 · 0 评论 -
之前写的检测mysql 从服务器延迟的脚本
超简易的查看mysql主从延时的脚本.原创 2015-08-09 22:45:14 · 1089 阅读 · 0 评论 -
django 模板
django view模板学习。原创 2015-08-12 16:18:25 · 952 阅读 · 0 评论 -
django创建model
django创建model原创 2015-08-13 09:16:36 · 2194 阅读 · 0 评论 -
django admin
django admin原创 2015-08-31 09:31:48 · 749 阅读 · 0 评论 -
python语法检查利器pychecker
一个很好的python语法检查工具原创 2015-09-09 11:13:15 · 6618 阅读 · 0 评论 -
django bootstrap3
django bootstrap3的简单使用原创 2015-09-11 13:30:34 · 4289 阅读 · 0 评论 -
[flask] hello
hello world flask原创 2016-06-15 10:59:51 · 520 阅读 · 0 评论