自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 orm

# -*- coding: utf-8 -*-"""------------------------------------------------- File Name: mysqlmanager Description : Author : Administrator date: 2019/8/11 0011-----------...

2019-08-11 16:30:00 162

转载 yield from

# -*- coding: utf-8 -*-"""------------------------------------------------- File Name: yield_from_example Description : Author : Administrator date: 2019/8/11 0011-----...

2019-08-11 15:00:00 138

转载 python虚拟环境解决不能执行脚本的问题

1 安装虚拟环境pip install virtualenv2 创建虚拟文件夹mkdir .venvs3.设置虚拟目录virtualenv --system-site-packages .venvs/lpthw -- 创建一个虚拟化环境lpthw4激活虚拟环境cdD:\.venvs\lpthw\Scripts.\actiate### 执行时 错误信息...

2019-07-21 21:47:00 1777

转载 ssh操作

# -*- coding: utf-8 -*-"""------------------------------------------------- File Name: ssh Description : Author : Administrator date: 2019/6/30 0030--------------------...

2019-06-30 11:19:00 128

转载 python ddt file_data

# -*- coding: utf-8 -*-"""------------------------------------------------- File Name: yml_test Description : Author : Administrator date: 2019/6/29 0029---------------...

2019-06-30 08:10:00 1134

转载 python excel写入及追加写入

# -*- coding:utf-8 _*- """ @author:Administrator @file: excel.py Description :如果行数是1000的倍数,进行一次flush,如果行数超过65536,新开一个sheet,如果超过3个sheet,则新建一个文件@time: 2018/10/31 """import osimport xlwtfrom xlrd im...

2018-11-09 11:11:00 1398

转载 centos备份多个数据库

#/bin/bash# the backup dateDATE=`date +%Y%m%d%H%M`#backup pathBACKUP_PATH=/home/backup/mysqldata#get all database nameSQL_STRING="SELECT SCHEMA_NAME AS db FROM information_schema.SCHEMATA WHERE S...

2018-10-30 09:50:00 113

转载 python super参数错误

# -*- coding:utf-8 _*-"""@author:Administrator@file: yamlparser.py@time: 2018/09/07"""class A(object): """ Method resolution order是python用来解析方法调用顺序的。 MRO对于多重继承中方法调用异常重要。python中有一个内建函 ...

2018-10-24 14:40:00 236

转载 jenkins 自动化部署执行shell

# -*- coding:utf-8 _*-""" @author:Administrator @file: new_app_publish.py @time: 2018/08/29 """import paramikoimport sysclass AppPush(object): def __init__(self, project, ip="", user="devr...

2018-09-13 14:22:00 81

转载 print number

# -*- coding: utf-8 -*-"""------------------------------------------------- File Name: printsquare Description : Author : Administrator date: 2018/9/8 0008-------------...

2018-09-08 22:56:00 539

转载 python selectsort

# -*- coding: utf-8 -*-"""------------------------------------------------- File Name: test Description : Author : Administrator date: 2018/9/2 0002--------------------...

2018-09-08 20:59:00 133

转载 github ssh

"""Generating a new SSH key1:open git bash 2:Paste the text below, substituting in your GitHub email address. $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" # this create a new ssh key,...

2018-09-01 10:08:00 97

转载 python ftp批量上传文件下载文件

# encoding:utf-8from ftplib import FTPimport osimport sys_XFER_FILE = 'FILE'_XFER_DIR = 'DIR'class FtpClient(object): def __init__(self): self.ftp = None def __del__(self): pass def s...

2018-08-24 17:35:00 679

转载 request redirection

# encoding:utf-8import reimport jsonimport randomfrom esdapi.config import BASE_URLfrom requests.sessions import Sessionclass Ad09(object): def __init__(self): """ 初始化session 并设置header和cook...

2018-08-21 15:25:00 174

转载 requests 获取token

# encoding:utf-8import reimport jsonimport randomfrom requests.sessions import Sessionclass Regist(object):  def __init__(self):    """初始化session 并设置header和cookie"""    self.url = "http://x...

2018-08-20 13:27:00 897

转载 mysql root password

"""centos:mysql忘记root密码解决1.修改MySQL的登录设置: # vim /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 例如: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-grant-tables2.重启mysqlsy...

2018-08-14 13:44:00 1081

转载 requests.session

# -*- coding: utf-8 -*-"""requests.session~~~~~~~~~~~~~~~~This module provides a Session object to manage and persist settings acrossrequests (cookies, auth, proxies)."""import osfrom collect...

2018-08-10 13:36:00 298

转载 split host

# encoding:utf-8_portprog = Nonedef split_host_port(host): """ split the host :param host: host like : xxxx.80 :return: host,port """ global _portprog if _portprog is None: import re _portpr...

2018-08-10 08:44:00 179

转载 requests session operation

# encoding:utf-8# baseic usage of requests.sessionsimport requestsfrom requests import sessionsr = requests.Request('GET', 'http://172.21.2.3:8009/ad09')print r.cookiess = sessions.Session()#...

2018-08-10 08:43:00 63

转载 实现线程安全先进先出的dict

# encoding:utf-8from collections import OrderedDictfrom collections import MutableMappingfrom threading import RLock_Null = object()def iterkeys(d, **kw): return d.iterkeys(**kw)def iterv...

2018-08-10 08:42:00 124

转载 转换为系统支持的字符串

import sysbuiltin_str = strver = sys.versionis_py2 = int(ver[0]) == 2is_py3 = int(ver[0]) == 3def to_native_string(string, encoding='ascii'): """Given a string object, regardless of type, ret...

2018-08-10 08:40:00 76

转载 Lookup dict 并将属性更新于lookupdict object中

# encoding:utf-8class LookupDict(dict): """Dictionary lookup object.""" def __init__(self, name=None): self.name = name super(LookupDict, self).__init__() def __repr__(...

2018-08-10 08:39:00 244

转载 Iterate over slices of a string

def iter_slices(string, slice_length): """Iterate over slices of a string.""" pos = 0 if slice_length is None or slice_length <= 0: slice_length = len(string) while pos <...

2018-08-10 08:35:00 121

转载 requests中自定义adapter

# encoding:utf-8import sslfrom requests import sessionsfrom requests import Requestfrom requests.adapters import HTTPAdapterfrom requests.packages.urllib3.poolmanager import PoolManagerclass ...

2018-08-10 08:32:00 1218

转载 python chrome的自定义启动

# encoding:utf-8"""@version: python27@author: fafa@site: http://www.phpgao.com@software: PyCharm Community Edition@file: chromeserver.py@time: 2018/7/29 0029 下午 5:24"""import timefrom selenium im...

2018-07-29 22:17:00 219

空空如也

空空如也

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

TA关注的人

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