![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
小喜子898
这个作者很懒,什么都没留下…
展开
-
基于python-httpserver上传下载共享
说明:本代码基于python-httpserver,实现过滤隐藏文件,完成修改时间排序import cgiimport htmlimport http.serverimport mimetypesimport osimport platformimport posixpathimport reimport shutilimport socketimport subprocessimport sysimport threadingimport timeimport urlli原创 2022-03-10 11:00:46 · 475 阅读 · 0 评论 -
基于locust的websocket压测
背景:locust默认内部只封装httplocust;使用的是requests中的session进行了封装;如果我想测试其它协议怎么办,比如websocket , grpc;我们只要重写一个实例给client即可:重写WebSocketClient类(主要用来替换掉self.client的http实例)class WebSocketClient(object): def __init__(self, host): self.host = host se.原创 2020-05-30 13:32:43 · 1938 阅读 · 1 评论 -
python批量生成手机号
# -*- coding: utf-8 -*-__author__ = 'Administrator'__time__ = '2018-05-07 下午 4:20'import stringimport randomf=open('d:\phone_num.txt','w',encoding='utf-8')def phone_num(num): num_start = ['...原创 2018-10-25 08:51:53 · 3534 阅读 · 0 评论 -
python图片识别文字
# -*- coding: utf-8 -*-__author__ = 'Administrator'__time__ = '2018-09-10 下午 3:55'import urllib,requests,re,json,base64,io,sysimport osimport timesys.stdout = io.TextIOWrapper(sys.stdout.buf...原创 2018-10-25 08:55:15 · 1107 阅读 · 1 评论 -
python生成日期格式:xxxx年xx月xx日
# -*- coding: utf-8 -*-__author__ = 'Administrator'__time__ = '2018-10-26 下午 2:57'import datetimeimport timeyear='年'month='月'day='日'cc=time.localtime(time.time())print(str(cc.tm_year)+year+...原创 2018-10-26 14:59:52 · 7941 阅读 · 0 评论 -
yum安装时报404错误
问题:Trying other mirror.http://172.16.100.100/Packages/rpm-devel-4.8.0-47.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"Trying other mirror.http://172...原创 2018-11-06 10:10:09 · 3295 阅读 · 2 评论 -
centos6.5-python2.7.12安装MySQLdb
1.下载:MySQL-python链接:https://pan.baidu.com/s/1g2iuk12HQKq_fBT7MEiiqA 提取码:itza tar -zxf MySQL-python-1.2.3b1.tar.gzcd MySQL-python-1.2.3b1python setup.py buildpython setup.py install2py...原创 2019-04-25 17:51:53 · 236 阅读 · 0 评论 -
Py-Spy-Python程序的抽样分析器Python
官网地址:https://github.com/benfred/py-spyy-Spy是Python程序的抽样分析器。 它允许您可视化Python程序正花费时间在哪部分,而无需重新启动程序或以任何方式修改代码。 Py-Spy的开销极低:它使用Rust语言编写,速度快,不会在与配置的Python程序相同的进程中运行,也不会以任何方式中断正在运行的程序。 这意味着Py-Spy可以安全地用于生产环境...原创 2019-07-22 17:17:39 · 600 阅读 · 1 评论 -
python生成姓名
# -*- coding: utf-8 -*-__author__ = 'Administrator'__time__ = '2018-08-29 下午 3:50'import random as rname=['赵', '钱', '孙', '李', '周', '吴', '郑', '王', '冯', '陈', '褚', '卫', '蒋', '沈', '韩', '杨', '朱', '...原创 2018-10-25 08:50:11 · 4227 阅读 · 0 评论 -
jmeter+jenkins+ant发送邮件
准备工作:jenkins+jmeter+ant+mysql+python流程图:安装配置篇:1、jmeter+jenkins+ant 安装略2、python3.6版本安装略(配置环境变量;安装pyinstaller:pip install pyinstaller;安装jinjia2: pip install jinjia2 官网:http://docs.jink原创 2017-11-09 16:06:04 · 1377 阅读 · 0 评论 -
python发送、抄送邮件
python发送抄送邮件sendemial.py#!/usr/bin/python# -*- coding: UTF-8 -*-import smtplibfrom email.mime.text import MIMETextfrom email.header import Headerfrom email.mime.multipart import MIMEMult原创 2017-11-17 11:21:37 · 13903 阅读 · 0 评论 -
pyinstaller打成exe可执行文件
pyinstaller打成exe可执行文件准备:pip install pyinstaller 安装pyinstaller -F xx.py 生成exe文件原创 2017-11-17 11:24:03 · 172 阅读 · 0 评论 -
python+selenium打开Google浏览器
前提准备:1、安装python3.6并配置环境变量2、安装selenium :pip install selenium3、下载Google驱动:将chromedriver.exe 放在chrome浏览器安装目录下(同时设置用户环境变量path:C:\Program Files (x86)\Google\Chrome\Application __author__ = 'kevi原创 2017-11-28 14:53:39 · 2159 阅读 · 0 评论 -
centos6.5系统python2.6升级到python2.7.12
准备:1、python2.7.12安装包(https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz)安装:1、解压缩[root@JY2XNTE21 jyapp]# tar zxvf Python-2.7.12.tgz [root@JY2XNTE21 jyapp]# cd Python-2.7.122、安装[root@JY2XN...原创 2018-05-30 16:31:14 · 690 阅读 · 0 评论 -
python-aes加密解密
准备工作:1、安装python2.7.12,步骤略 下载链接(链接:https://pan.baidu.com/s/1OA7UxQl47rKTwy5CHuB5Dw 密码:jlt2)2、配置好python环境变量,验证是否安装成功3、下载pycrypto-2.6.win32-py2.7.exe,安装pycrypto4、pip 安装pkcs7、binascii、base64方法...原创 2018-08-30 15:09:28 · 1212 阅读 · 1 评论 -
python获取redis连接数等信息
# -*- coding: utf-8 -*-__author__ = 'Administrator'__time__ = '2018-04-28 上午 10:34'import redisimport sysimport timeHOST='172.18.101.29'PORT='6579'times=5000result_file='D://re.txt'#HOST=s...原创 2018-10-25 08:45:55 · 3628 阅读 · 0 评论 -
python批量生成银行卡号
# -*- coding: utf-8 -*-__author__ = 'Administrator'__time__ = '2018-07-27 下午 2:38'import stringimport randomdef phone_num(num): num_start = ['']bank = []#for i in range(17918000000,179189999...原创 2018-10-25 08:47:18 · 5027 阅读 · 0 评论 -
python3.6 安装pymysql
准备工作:1、下载python3.6.1安装包(Windows)2、安装完成后配置环境变量3、检查pip是否安装安装篇原创 2017-11-07 16:56:37 · 1989 阅读 · 0 评论