- 博客(63)
- 资源 (2)
- 收藏
- 关注
原创 odoo安装学习
1、下载Odoo 12git clone https://www.github.com/odoo/odoo --branch master --depth 1 --single-branch ./Odoo12国内镜像git clonehttps://gitee.com/mirrors/odoo.git--depth 1 --branch 12.0 --singl...
2019-07-22 20:40:48
500
1
原创 PostgreSQL学习笔记
一、安装Centos:添加RPM:-- centos 6 安装 postgresql 10yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm-- centos 7 安装 postgresql 10...
2019-07-22 10:41:56
276
原创 pywinauto和PyUserInput实现windows程序自动化
一、pywinauto官方文档:https://pywinauto.readthedocs.io/en/latest/code/code.html首先需要下个spy++lite,便于查看程序窗口属性主要模块:pywinauto.application创建对象:app = application.Application()启动程序:app.start(cmd_line...
2019-07-21 16:43:02
1673
原创 .whl is not a supported wheel on this platform错误处理
$ pip install pyHook-1.5.1-cp37-cp37m-win_amd64.whlERROR: pyHook-1.5.1-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.查看pip支持版本
2019-07-15 21:04:50
3207
原创 使用pillow处理图像
1、安装pillowpip install pillow2、打开图片from PIL import Imageim = Image.open('./templates/images/002-01.jpg')im.show()3、图片信息print(im.format,im.size,im.mode)4、剪切ret = 200,0,300,50im....
2019-05-21 14:42:20
1760
原创 测试驱动开发(Django)20
第20章 测试固件和一个显示等待装饰器20.1 事先创建好会话,跳过登录过程邮件登录成功后注册cookie.用户ID存储在django.contrib.auth.SESSION_KEYfunctional_tests/test_mylists.py#!/usr/bin/python3# -*- coding: utf-8 -*-# @Author : Marvin King...
2019-03-01 20:29:02
334
原创 测试驱动开发(Django)15
第15章 高级表单15.1 针对重复待办事项的功能测试functional_tests/test_list_item_validation.py增加一个测试方法 def test_cannot_add_duplicate_items(self): #乔伊访问首页,新建一个清单 self.browser.get(self.live_server_...
2019-02-26 12:14:05
292
原创 测试驱动开发(Django)14
第14章 简单的表单Django鼓励使用表单类验证用户输入和显示错误信息。14.1 把验证逻辑移动到表单中在Django中视图很复杂则说明代码异味。考虑如何把逻辑移动到表单或模型类中。Django表单的功能:可以处理用户输入并加以验证 可以在模板中使用,并且有不同的渲染以及错误消息 可以把数据存入数据库14.1.1 使用单元测试探索表单APIlists/forms.p...
2019-02-25 20:58:50
331
原创 测试驱动开发(Django)13
第13章 数据库层验证13.1 模型层验证服务端的验证分为:模型层和表单层。13.1.1 self.assertRaises上下文管理器lists/tests/test_models.py def test_cannot_save_empty_list_items(self): list_ = List.objects.create() i...
2019-02-23 22:25:16
328
原创 测试驱动开发(Django)12
第12章 输入验证和测试的组织方式12.1 针对验证的功能测试:避免提交空待办事项functional_tests/tests.py def test_can_not_add_empty_list_items(self): # 乔伊访问首页,不小心提交一个空待办事项 # 输入框中没输入内容,她就按下了回车 #首页...
2019-02-22 21:56:25
169
原创 测试驱动开发(Django)11
第11章 使用Fabric自动部署安装 pip install fabric3deploy_tools/fabfile.py#!/usr/bin/python3# -*- coding: utf-8 -*-# @Author : Marvin King# Date : 2019-02-21 from fabric.api import env, local,...
2019-02-22 19:46:54
127
原创 测试驱动开发(Django)10
第10章 为部署到生产环境做好准备10.1 换用GunicornDjango的吉祥物是一匹小马。现在有一只小马了,但更需要一头“绿色独角兽”--Guincorn(green unicorn)。服务器:cd /home/sites/superlists-staging.com/source ../virtualenv/bin/pip install gu...
2019-02-21 15:24:32
159
原创 测试驱动开发(Django)9
9.1 TDD及部署的危险区域静态文件(css、JavaScript、图片等) web服务器往往需要特殊配置才能伺服静态文件数据库 可能会遇到权限和路径问题,在多次部署之间不能丢失数据依赖 要保证服务器上安装了网站依赖的包且版本正确解决方案:使用与生产环境一样的基础架构部署过渡网站(staging site),这么做可以测试部署过程,确...
2019-02-20 17:15:01
172
原创 centos下安装Nginx
安装之前,最好检查一下是否已经安装有nginx:find -name nginx 如果已经安装了nginx,想要卸载:yum remove nginx 1、检查并安装基础依赖包(1)安装pcre库(使Nginx支持URI重写的rewrite模块)检查:rpm -qa pcre-devel pcre安装:yum install pcre pcre-devel -y(2)...
2019-02-18 23:34:13
212
原创 测试驱动开发(Django)8
第8章 美化网站:布局,样式及测试方法8.1 如何在功能测试中测试布局和样式如果执行Python manage.pu runserver 时,出现错误:“table lists_item has no column named list_id".需要执行python manage.py migrate ,更新本地数据库,让models.py中的改动生效。如果提醒IntegrityError...
2019-02-18 16:03:59
359
原创 测试驱动开发(Django)7
第7章 步步为营7.1 必要时做少量的设计7.1.1 不要预先做大量设计7.1.2 YAGNI7.1.3 REST本章便签 :调整模型,让待办事项和不同的清单关联起来 为每个清单添加唯一的URL 添加通过POST请求新建清单所需URL 添加通过POST请求在现有的清单中增加新待办事项所需的URL7.2 使用TDD实现新设计7.3 确保出现回归测试引入第二个用...
2019-02-12 19:05:11
763
4
原创 测试驱动开发(Django)1~6
准备工作:1,安装Firefox安装geckodriver首先通过brew 安装$ brew install geckodriver然后设置配置文件~/.bash_profile文件export PATH=$PATH:'/usr/local/Cellar/geckodriver/0.23.0/bin'这里的路径一直到geckodriver下的bin目录在安装完成...
2019-02-05 00:07:14
1370
原创 解决不受信任的自签名证书问题
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed在全局导入import sslimport sslssl._create_default_https_context = ssl._create_unverified_context...
2019-02-03 22:28:02
8128
1
原创 Scikit-learn学习
目录一,安装二、数据的特征提取1、字典特征提取2、文本特征提取3、数据的特征处理4、缺失值的处理5、特征降维三、数据集四、分类算法1、K近邻算法2、朴素贝叶斯算法模型的选择与调优3、决策树4、随机森林5、逻辑回归五、回归算法1、线性回归欠拟合与过拟合回归算法之岭回归保存模型与载入模型2、逻辑回归六、非监督...
2019-02-02 22:02:38
859
原创 Mac 安装virtualenvwrapper
1. 安装:#安装virtualenv(sudo) pip install virtualenv #安装virtualenvwrapper(sudo) pip install virtualenvwrapper 2,配置:修改~/.bash_profile或其它环境变量相关文件(如 .bashrc(我的Ubuntu15.10 下的是这个) 或用 ZSH 之后的 .z...
2019-01-31 16:18:56
503
原创 pandas练习
import pandas as pdimport numpy as npfrom matplotlib import pyplot as pltdf = pd.read_csv('/Users/PycharmProjects/newwork/BeijingPM20100101_20151231.csv')df.head(3) No ...
2019-01-30 22:27:25
631
原创 centos下安装mysql
1,下载发行包wget http://repo.mysql.com/mysql80-community-release-el6-2.noarch.rpm 2,安装发行包sudo rpm -Uvh mysql80-community-release-el6-2.noarch.rpm 3,安装服务端yum install -y mysql-community-serve...
2019-01-30 20:32:54
168
原创 Numpy练习
Numpy练习import numpy as npa = np.array([1,2,3,4,5])b = np.array(range(1,6))c = np.arange(1,6)数组类名type(a)type(b)type(c)numpy.ndarray数据类型a.dtypedtype('int32')b.dtypedtype('int32')c...
2019-01-24 21:38:32
449
原创 mac查看支持字体:fc-list
1,使用brew安装fontconfigbrew install fontconfig2,fc-list查看支持中文:fc-list :lang=zh (注意‘:’前的空格)
2019-01-18 23:44:18
5621
原创 selenium安装与使用
目录一、安装二、使用1、声明浏览器对象2、访问页面3、查找节点4、动作链5、执行js代码6、切换Frame7、延时等待8、前进与后退9、Cookies10、操作标签页11、异常处理一、安装1,pip3 install selenium #注意新版本标注不再支持phantomjs2,下载各浏览器驱动(以chrome...
2019-01-08 00:12:52
2246
原创 request模块学习
模块内的注释def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :param method: method for the new :class:`Request` object. :param url: URL for th...
2018-12-20 13:45:56
389
原创 无法检测到zmodem信号
-bash: rz command not found 无法检测到zmodem信号 yum -y install lrzsz 现在就可以正常使用rz、sz命令上传、下载数据了。 使用方法:上传文件# rz filename 下载文件# sz filename...
2018-12-19 21:58:45
1004
原创 centos 安装 pyhon3
centos 6.9 安装pyhon3 1,安装依赖:yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel gcc gcc++ 2...
2018-12-19 21:52:40
245
原创 centos下Redis安装与连接
1,下载安装包: wget http://download.redis.io/releases/redis-4.0.2.tar.gz2,解压编译安装 tar xzf redis-4.0.2.tar.gzcd redis-4.0.2makemake install *****************************...
2018-12-19 19:52:32
262
原创 Redis
Redis:remote dictionary service1,优点1、异常快速:Redis的速度非常快,每秒能执行约11万集合,每秒约81000+条记录。2、支持丰富的数据类型:Redis支持Redis支持五种数据类型:string(字符串),hash(哈希),list(列表),set(集合)及zset(sorted set:有序集合)。这使得它非常容易解决各种各样的问题,因为我们...
2018-12-18 20:08:21
203
原创 Tornado 学习<1>
1,基础功能#!/usr/bin/python3# -*- coding: utf-8 -*-# @Author : Marvin King# Date : 2018-11-27 import tornado.ioloopimport tornado.webclass MainHandler(tornado.web.RequestHandler): def...
2018-11-27 22:46:52
274
原创 python中gevent模块使用及出现MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may
出现MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors需要调整一下导入顺序import geventfrom gevent import monkeymonkey.patch_all()import requests #导入顺序,否则会报...
2018-10-25 17:20:33
8936
原创 beautifulsoup模块学习
模块安装:pip3 install beautifulsoup4from bs4 import BeautifulSouphtml_doc = """<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title&
2018-10-16 16:39:01
474
原创 CookBook练习1
#! /usr/bin/env python# -*- coding: utf-8 -*-# 1.1.2# 将元组或序列分解为单独变量# p=(4,5)# x,y=p# print(x)# print(y)# date=['AMCE',50,91.1,(2012,12,21)]# # name,shares,price,date= date# # print(date)#...
2018-08-01 20:16:50
202
原创 django之form组件
一、验证功能html<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body>
2018-07-30 10:36:35
266
转载 解决pip install慢的方法
常在使用python的时候需要安装各种模块,而pip是很强大的模块安装工具,但是由于国外官方pypi经常被墙,导致不可用,所以我们最好是将自己使用的pip源更换一下,这样就能解决被墙导致的装不上库的烦恼。网上有很多可用的源,例如豆瓣:http://pypi.douban.com/simple/ 清华:http...
2018-07-29 16:20:08
1108
原创 django练习
1,创建project2,settings中添加STATIC_URL = '/static/'STATICFILES_DIRS = ( os.path.join(BASE_DIR,'static'),)创建‘static’目录,加入JS3,modelsfrom django.db import modelsclass Classes(models.Model...
2018-07-28 15:34:06
398
原创 django分页
一,最简单的分页viewsfrom django.shortcuts import renderL_list =[]for i in range(1,999): temp = {'name':'root'+str(i),'age':i} L_list.append(temp)def index(request): per_page_count=10 ...
2018-07-28 15:33:27
256
原创 二分查找
def binary_search(list,item): low = 0 high = len(list)-1 sum = 0 while low <= high: mid = (low+high)//2 #整除 guess = list[mid] sum +=1 #猜...
2018-07-18 20:50:20
237
原创 MySQL学习笔记
一、数据库操作(DDL)1,创建数据库CREATE DATABASE test;实际上是在data目录下创建 CREATE DATABASE if not exists test;如果同名是不会创建2,查看SHOW DATABASES; 查看所有数据库SHOW CREATE DATABASE test; 查看创...
2018-07-18 20:31:56
222
dex2jar - 2.0
2020-05-17
adb版本1.0.40 version(40)
2020-05-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人