05 2017 档案

摘要:```python import logging logging.basicConfig( level=logging.DEBUG, format='[%(asctime)s ] [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S', # 日志输出到文件,文件名字可以自定义 # filename... 阅读全文
posted @ 2017-05-29 21:38 sawyer_aquarius
摘要:参考:http://docs.pythontab.com/interpy/c_extensions/ctypes/ Python中的ctypes模块可能是Python调用C方法中最简单的一种。ctypes模块提供了和C语言兼容的数据类型和函数来加载dll文件,因此在调用时不需对源文件做任何的修改。也 阅读全文
posted @ 2017-05-29 13:08 sawyer_aquarius 阅读(229) 评论(0) 推荐(0)
摘要:参考:http://docs.pythontab.com/ 实现该类的单例模式,使用装饰器的方法。装饰器实现单例模式的方法如下 输出的结果 python2.7 \ 4 \ 6 \ 35090992 35090992 阅读全文
posted @ 2017-05-29 10:55 sawyer_aquarius 阅读(176) 评论(0) 推荐(0)
摘要:Django admin的设置 1.setting.py配置 创建数据库djangoproject 创建admin超级管理员 登录 阅读全文
posted @ 2017-05-29 00:10 sawyer_aquarius 阅读(121) 评论(0) 推荐(0)
摘要:项目创建 创建后的目录截图如下 urls.py设定 写一个小视图模板进行测试 app_user:view.py 编写视图,构建上下文,生成html网页,设定cookie值 修改搜索的模板路径 启动测试服务器 浏览器运行的结果 第一篇,写完了,后续会继续更新。欢迎大家批评指正。 阅读全文
posted @ 2017-05-28 23:39 sawyer_aquarius 阅读(150) 评论(0) 推荐(0)
摘要:单例模式 阅读全文
posted @ 2017-05-28 18:21 sawyer_aquarius 阅读(94) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-05-28 00:03 sawyer_aquarius 阅读(140) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-05-27 23:21 sawyer_aquarius 阅读(98) 评论(0) 推荐(0)
摘要:NAME=100 定义局部变量 export NAME=100 定义环境变量 unset NAME 清除变量 echo 查看字符串 env 查看环境变量 $() ...`` $((NAME+10)) $[2#10+7] \:转义 阅读全文
posted @ 2017-05-26 09:43 sawyer_aquarius 阅读(96) 评论(0) 推荐(0)
摘要:一、安装Redis 安装Redis:http://redis.io/download 安装完成后,拷贝一份Redis安装目录下的redis.conf到任意目录,建议保存到:/etc/redis/redis.conf (Windows系统可以无需变动) 二、修改配置文件 redis.conf 打开你的 阅读全文
posted @ 2017-05-16 00:50 sawyer_aquarius 阅读(156) 评论(0) 推荐(0)
摘要:#修改git配置 vi .gitconfig #生成秘钥 ssh-keygen -t rsa -C "邮箱地址" #查看秘钥 cat id_rsa.pub 阅读全文
posted @ 2017-05-15 00:12 sawyer_aquarius 阅读(138) 评论(0) 推荐(0)
摘要:select department.name from employee inner join department on departmentld=department.id group by departmentld order by avg(salary) desc limit 0,3; 查询 阅读全文
posted @ 2017-05-08 21:28 sawyer_aquarius 阅读(133) 评论(0) 推荐(0)
摘要:#coding:utf-8 #求列表的第二大值 list_test =[6,2,4,6,1,2,3,4,5] list_test.sort() print list_test[-2] """6""" help(list_test.sort) """Help on built-in function sort: sort(...) L.sort(cmp=None, key=None... 阅读全文
posted @ 2017-05-08 18:58 sawyer_aquarius 阅读(188) 评论(0) 推荐(0)