08 2017 档案

摘要:。。。 “”“ 可以实现并发,请求发送出去后和返回之前,中间时期线程空闲 “”“ # 编写方式一: 直接返回处理 from concurrent.futures import ThreadPoolExecutor import requests def task(url): response = r 阅读全文
posted @ 2017-08-31 18:05 golangav 阅读(347) 评论(0) 推荐(0)
摘要:1. 浏览器访问服务器返回二维码 浏览器会发长轮训 等待用户扫 2. 手机扫码,向服务器发送 “已经扫码” 长轮训携带头像回去,页面看到头像 3. 浏览器继续向服务器发送查看 用户是否点击确定 用户点击确定 服务端把数据传给浏览器,登录成功 阅读全文
posted @ 2017-08-31 17:33 golangav 阅读(277) 评论(0) 推荐(0)
摘要:。。。 request web微信 性能 scrapy爬虫 阅读全文
posted @ 2017-08-28 18:23 golangav 阅读(269) 评论(0) 推荐(0)
摘要:一. requests 参数 a. url 1. 分析url - https://www.baidu.com/s?wd=美女 = https://www.baidu.com/s?wd=%E7%BE%8E%E5%A5%B3 - 导入from urllib.parse import urlencode 阅读全文
posted @ 2017-08-28 18:20 golangav 阅读(491) 评论(0) 推荐(0)
摘要:一. 基本介绍 什么是爬虫? - 就是抓取网页数据的程序 怎么抓取网页数据 网页三大特征: - 每个网页都有自己的URL (统一资源定位符) 来进行定位 - 网页都是用HTML(超文本标记语言)来描述页面信息 - 网页都使用HTTP/HTTPS(超文本传输协议)来传输HTML数据 爬虫的设计思路: 阅读全文
posted @ 2017-08-26 20:52 golangav 阅读(445) 评论(0) 推荐(0)
摘要:a.实例化类 class Dog(object): def __init__(self): print(" init方法 ") def __new__(cls, *args, **kwargs): print(" new方法 ") xtq = Dog() # 结果 new方法 b. 单例 class 阅读全文
posted @ 2017-08-26 17:34 golangav 阅读(264) 评论(0) 推荐(0)
摘要:from django.db import models class UserProfile(models.Model): """ 用户信息 """ name = models.CharField(u'姓名', max_length=32) email = models.EmailField(u'邮 阅读全文
posted @ 2017-08-25 16:18 golangav 阅读(196) 评论(0) 推荐(0)
摘要:1. 试列出至少三种目前流行的大型关系数据库的名称 2. 有表list,共有字段ABC类型都是整数,表中有如下记录: 现在对该表依次完成以下操作:(1) 查询出B、C列的值,要求按B列升序排序: (2) 写一条新的纪录,值为 7 8 9 (3) 查询C列,要求清除重复的值,按降序排列: 3. 视图的 阅读全文
posted @ 2017-08-24 18:37 golangav 阅读(682) 评论(0) 推荐(0)
摘要:pandas a.基本使用 #结构化的数据分析 pip3 install jupyter pip3 install pandas #import pandas as pd #import numpy as np #事例一: #s = pd.Series([1,3,5,np.NaN,8,4]) #s 阅读全文
posted @ 2017-08-20 20:10 golangav 阅读(786) 评论(0) 推荐(0)
摘要:一. Numpy 常用操作 a. xxxx import numpy as np print(np.arange(1,11)) #[ 1 2 3 4 5 6 7 8 9 10] print(np.arange(1,11).reshape([2,5])) # [ # [ 1 2 3 4 5] # [ 阅读全文
posted @ 2017-08-20 16:21 golangav 阅读(623) 评论(0) 推荐(0)
摘要:Numpy pandas 阅读全文
posted @ 2017-08-19 18:44 golangav 阅读(303) 评论(0) 推荐(0)
摘要:a. 事例一: b. 事例二: 阅读全文
posted @ 2017-08-16 22:08 golangav 阅读(250) 评论(0) 推荐(0)
摘要:# import random # print(random.random()) #0-1的小数 # print(random.randint(1,3)) #包括1和3 # print("--",random.randrange(1,3)) #不包括1和3 #随机生成四位验证码 import random checkcode = '' for i ... 阅读全文
posted @ 2017-08-15 18:59 golangav 阅读(761) 评论(0) 推荐(0)
摘要:安装shellinabox-master a. 安装 b. 检查4200端口是否启动 c. 访问网站 阅读全文
posted @ 2017-08-15 09:02 golangav 阅读(390) 评论(1) 推荐(0)
摘要:Centos7 安装python3 Windows 安装 windows环境下 安装python2和python3 阅读全文
posted @ 2017-08-10 22:43 golangav 阅读(584) 评论(1) 推荐(0)
摘要:pip3 install django #安装rabbitmq连接模块 pip3 install pika pip3 install paramiko pip3 install ipython pip3 install lxml 阅读全文
posted @ 2017-08-09 17:25 golangav 阅读(259) 评论(0) 推荐(0)
摘要:命令行执行Django脚本 阅读全文
posted @ 2017-08-09 16:48 golangav 阅读(416) 评论(0) 推荐(0)
摘要:数据库设计 命令行执行Django脚本 安装shellinabox-master 安装shellinabox-master 一. 简单开发: yum install epel-release -y yum install strace chmod u+s `which strace` yum ins 阅读全文
posted @ 2017-08-09 15:11 golangav 阅读(407) 评论(0) 推荐(1)
摘要:审计系统(堡垒机) from django.db import models from django.contrib.auth.models import User # Create your models here. class IDC(models.Model): name = models.C 阅读全文
posted @ 2017-08-09 15:04 golangav 阅读(371) 评论(0) 推荐(0)
摘要:一. RabbitMQ队列 a. 安装 b. 创建用户 授权 #远程连接rabbitmq server的话,需要配置权限 #创建用户 rabbitmqctl add_user alex alex3714 #同时还要配置权限,允许从外面访问 rabbitmqctl set_permissions -p 阅读全文
posted @ 2017-08-08 12:55 golangav 阅读(444) 评论(1) 推荐(3)
摘要:git a. 回滚 b. 案例一: #开发短信功能 创建msg.txt文件 git add . git commit -m '开发短信功能' #回滚(无短信功能): git log git reset --hard 版本号 #再次回到短信功能: git reflog # 底下两部操作等于 git r 阅读全文
posted @ 2017-08-07 19:32 golangav 阅读(424) 评论(0) 推荐(0)
摘要:xxx 三元表达式 name="alex" res="SB" if name == "alex" else "shuai" print(res) SB 列表生成式 语法 [expression for item1 in iterable1 if condition1 for item2 in ite 阅读全文
posted @ 2017-08-06 16:43 golangav 阅读(716) 评论(0) 推荐(0)
摘要:生成器 from collections import Iterator def test(): print("one") yield 1 print("two") yield 2 print("three") yield 3 obj = test() res = next(obj) print(r 阅读全文
posted @ 2017-08-06 11:46 golangav 阅读(327) 评论(0) 推荐(0)
摘要:迭代器 可迭代对象(iterable) 概念 实现了迭代器协议的对象(只要对象本身有__iter__方法,那它就是可迭代的) 可以直接作用于for循环的对象统称为可迭代对象 判断一个对象是否可迭代对象 1. isinstance() 使用isinstance()判断一个对象是否是Iterable对象 阅读全文
posted @ 2017-08-05 19:04 golangav 阅读(487) 评论(0) 推荐(0)
摘要:函数 好处 代码重用 保持一致性,易维护 可扩展行 参数 形参 形参变量在被调用时分配内存单元,调用结束时释放所分配的内存单元 实参 实参可以是常量,变量,表达式,函数 作用域 全局作用域 全局名称空间 内置名称空间 局部作用域 局部名称空间 变量 全局变量 在程序的一开始定义的变量 作用域是整个程 阅读全文
posted @ 2017-08-05 18:59 golangav 阅读(277) 评论(0) 推荐(1)
摘要:highchart a. 简单例子 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div id="container" style="width: 阅读全文
posted @ 2017-08-05 10:16 golangav 阅读(488) 评论(0) 推荐(0)
摘要:a.为字符串创建format方法,用于字符串格式化 阅读全文
posted @ 2017-08-02 19:29 golangav 阅读(374) 评论(0) 推荐(0)
摘要:查 a. 基本实现 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <link rel="stylesheet" href="/static/bootstrap/css/bootstrap. 阅读全文
posted @ 2017-08-02 18:12 golangav 阅读(735) 评论(0) 推荐(0)
摘要:序列化 a. 两种方式 b. 由于json.dumps时无法处理datetime日期,所以可以通过自定义处理器来做扩展,如: #每个字段都会验证一遍,都会执行default函数 import json from datetime import date from datetime import da 阅读全文
posted @ 2017-08-02 08:38 golangav 阅读(208) 评论(0) 推荐(0)
摘要:AES(高级加密) a. 事例: wuSir 阅读全文
posted @ 2017-08-01 11:10 golangav 阅读(379) 评论(0) 推荐(0)