自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

转载 python 单例实现

class View: _instance = None def __new__(cls, *args, **kwargs): if cls._instance is None: cls._instance = super(View, cls).__new__(cls) return cls._instance...

2017-10-11 12:44:00 85

转载 logging 简单使用

import logginglogging.basicConfig( level=logging.DEBUG, format='[%(asctime)s <%(filename)s :%(lineno)d>] [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S', # 日志输出到...

2017-05-29 21:38:00 92

转载 CTypes

参考:http://docs.pythontab.com/interpy/c_extensions/ctypes/Python中的ctypes模块可能是Python调用C方法中最简单的一种。ctypes模块提供了和C语言兼容的数据类型和函数来加载dll文件,因此在调用时不需对源文件做任何的修改。也正是如此奠定了这种方法的简单性。示例如下实现两数求和的C代码,保存为add.c//s...

2017-05-29 13:08:00 128

转载 类装饰器使用

参考:http://docs.pythontab.com/from functools import wrapsclass logit(object): def __init__(self, logfile='out.log'): self.logfile = logfile def __call__(self, func): @w...

2017-05-29 10:55:00 79

转载 Django admin

Django admin的设置1.setting.py配置DATABASES = { # # 'default': { # 'ENGINE': 'django.db.backends.sqlite3', # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), # } 'defau...

2017-05-29 00:10:00 69

转载 Django 视图

项目创建python s.py djangoproject usr_app创建后的目录截图如下urls.py设定#djangoproject的urls.py指向app_user的urls.py--namespace:模块名from django.conf.urls import include, urlfrom django.contrib import adminu...

2017-05-28 23:39:00 66

转载 单例模式

单例模式class TestSingle(object): """使用父类的new方法初始换一个实例。 new方法会自动接收类创建时的参数,所以要设定不定长的参数 """ def __new__(cls, *args, **kwargs): if not hasattr(cls, "_instance"): ...

2017-05-28 18:21:00 58

转载 django --视图装饰器

转载于:https://www.cnblogs.com/by2016/p/6914781.html

2017-05-28 00:03:00 73

转载 reduce/filter/map/zip/isinstance/list列表推导式

转载于:https://www.cnblogs.com/by2016/p/6914730.html

2017-05-27 23:21:00 69

转载 shell

NAME=100 定义局部变量export NAME=100 定义环境变量unset NAME 清除变量echo 查看字符串env 查看环境变量$() ...``$((NAME+10))$[2#10+7]\:转义转载于:https://www.cnblogs.com/by2016/p/6907019.html...

2017-05-26 09:43:00 45

转载 安装Redis

一、安装Redis安装Redis:http://redis.io/download安装完成后,拷贝一份Redis安装目录下的redis.conf到任意目录,建议保存到:/etc/redis/redis.conf(Windows系统可以无需变动)二、修改配置文件 redis.conf打开你的redis.conf配置文件,示例:非Windows系统:su...

2017-05-16 00:50:00 63

转载 git秘钥生成

#修改git配置vi .gitconfig#生成秘钥ssh-keygen -t rsa -C "邮箱地址"#查看秘钥cat id_rsa.pub转载于:https://www.cnblogs.com/by2016/p/6854581.html

2017-05-15 00:12:00 85

转载 联合查询

select department.namefrom employee inner join department on departmentld=department.id group by departmentldorder by avg(salary) desclimit 0,3;查询不同部门的工资的前三名create view salary_vi...

2017-05-08 21:28:00 72

转载 python 排序之sort

#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(...

2017-05-08 18:58:00 99

转载 python3-asyncio异步爬虫测试(无注释demo)

#!/usr/bin/python3"this is a spider"import reimport asyncioimport urllib.request, urllib.parse, urllib.errorimport http.cookiejarasync def html(urlAddr): req = url...

2017-02-26 17:21:00 155

转载 python3 asyncio-协程模块测试代码

import timeimport asyncio#统计运行时间的装饰器def run_time(func): def wrapperfunc(*argv, **kwargv): now = lambda : time.time() start = now() func(*argv, **kwargv...

2017-02-23 16:11:00 79

转载 VIM --使用进阶 -- 插件篇 -- YouCompleteMe -- nerdtree

系统:ubuntu:资源:https://github.com/其他:想了解都要哪些好用的插件,推荐大家读http://blog.csdn.net/mergerly/article/details/51671890 这个博客的内容很赞。vim本身是一个非常优秀的编辑器,为了提升使用流畅感,增加一些功能,就需要安装一些插件,先放一张个人常用的vim界面截图。左侧可以快速...

2017-02-16 13:00:00 122

转载 R语言爬虫 rvest包 html_text()-html_nodes() 原理说明

library(rvest)   例子网页:http://search.51job.com/jobsearch/search_result.php?fromJs=1&jobarea=010000%2C00&funtype=0000&industrytype=00&keyword=%E6%95%B0%E6%8D%AE&keywordtyp...

2016-07-09 19:21:00 2794

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除