![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python学习
ZeKyll
这个作者很懒,什么都没留下…
展开
-
python 异步非阻塞的简单实现
python 利用装饰器简单实现异步非阻塞原创 2021-12-31 09:45:00 · 2102 阅读 · 2 评论 -
Mac安装AES加密模块pycrypto
AES加密模块安装后,代码中import仍然显示为找不到?安装命令:pip3 install pycrypto回到IDE一看,仍然是为报错状态:此时,需要到到python安装路径/site-packages/下更改文件夹名称crypto为Crypto。问题解决!!...原创 2021-12-03 10:59:23 · 2754 阅读 · 1 评论 -
python中ThreadPoolExecutor线程池
ThreadPoolExecutorpython3标准库concurrent.futures中常用的线程池ThreadPoolExecutor特点:主线程可以获取某一个线程的状态,以及返回值。线程同步让多线程和多进程的编码接口一致。简单粗暴上手操练将使用ThreadPoolExecutor线程池,将文件读取出来,并在文件每一行行末追加内容_我是吊车尾第一步,假设有个文件,20000行,第一行数据为”1“,后续自增。(直接代码写一个)index=1line_list=[]for原创 2021-05-17 11:43:12 · 3266 阅读 · 3 评论 -
Python之pip安装失败:ReadTimeoutError: HTTPSConnectionPool(host=“xxx'', port=): Read timed out.
今天安装opencv-python时,出现错误提示:ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.网上查了下,可能是网络的原因,导致连接资源超时了,只要自定义连接延迟时间就可以解决。So,更改pip安装命令如下:pip3 insta...原创 2020-01-14 16:13:35 · 2531 阅读 · 0 评论 -
Appium(一):环境搭建
Appium简介:官网介绍:Appium is an open-source tool you can use to automate mobile native, mobile web, and mobile hybrid applications on iOS and Android platforms. “Mobile native apps” are those written u...原创 2019-01-09 11:53:45 · 193 阅读 · 0 评论 -
Python之pip安装失败----Could not find a version that satisfies the requirement xxxx(from versions: )
今天在使用pip安装模块的时候,发现无法使用。报错信息:Could not find a version that satisfies the requirement xxxxxxx(from versions: )No matching distribution found for xxxxx如图:网上查询了下,可能是网络的问题,所以,这里需要用国内的镜像源来下载pip ...原创 2019-01-08 16:38:54 · 63852 阅读 · 47 评论 -
Python之unittest单元测试框架
用Python搭建自动化测试框架,我们需要组织用例以及测试执行,这里博主推荐Python的标准库——unittest。unittest是xUnit系列框架中的一员,如果你了解xUnit的其他成员,那你用unittest来应该是很轻松的,它们的工作方式都差不多。unittest核心工作原理unittest中最核心的四个概念是:test case, test suite, test r...转载 2019-01-08 15:04:41 · 263 阅读 · 0 评论 -
Appium(二):第一条测试脚本
Appium(一):环境搭建上一篇博文中已经搭建好了整个appium的运行环境,接下来就是需要写一条自动化的测试脚本。我们需要配置Appium应用程序:1、手机连接PC,开启USB调试,从cmd窗口中输入adb deivces 来获取当前连接设备的deviceID2、双击打开PC端桌面Appium图标,进入Appium界面。点击Android机器人图标,设置对应的值,3、点...原创 2019-01-10 15:08:39 · 824 阅读 · 0 评论 -
Python中定时启动任务
# coding=utf-8import sys, timereload(sys)sys.setdefaultencoding('utf-8')# 固定间隔interval秒时间,执行一个方法class Loop_Run: ''' interval:间隔的时间 exec_fun:执行的方法 ''' def loop_start(self,...原创 2018-12-25 15:26:36 · 1741 阅读 · 0 评论 -
Python在pycharm工具中输出不同颜色的文字
在pycharm中,Python的print默认向屏幕输出指定的文字,一般所有的print输出都是指定一个颜色的。有时候我们需要输出不同颜色的内容的时候(例如多线程中,每个线程打印出的log颜色不一样,用于区分。又例如打印错误的log,用红色,警告的log用黄色,正常的log,用绿色),应该要怎么做呢?python中提供了一种输出格式:格式:"\033[显示方式;前景色;背景色m 需要输出...原创 2018-12-27 15:12:26 · 8943 阅读 · 3 评论 -
Python发送邮件模块(SMTP)
首先,使用SMTP实现发送邮件的话,需要先获取一个代发邮件的授权码。以163邮箱为例:登录邮箱后--点击设置--客户端授权码--开启。如图其实网上已经有很多类似的模块介绍和试用了,这边主要是想记录下自己写的一个类。调用方式简单,可以直接将py文件贴到项目中,import后直接调用,方便快捷,简单高效。# coding=utf-8import sys, os, fileinp...原创 2018-12-20 17:06:57 · 1382 阅读 · 2 评论 -
Python基本数据类型
1、numerics,sequences,mappings,classes,instances,and exceptions2、Numeric Types:int(包含boolean),float,complex3、int: unlimited length;float;实现用douuble in c,可查看sys.float_info.........................原创 2016-03-16 19:57:54 · 185 阅读 · 0 评论 -
Python 引用包
引用的包分为2种,build-in和extranal两种1、build-in:import osprint(os.getcwd)2、extranal分为2种方式easy_insatll:pip:需要注意的是:3.4的版本自带了可执行文件easy_insatll.exe和pip.exe,如果要使用,需要添加环境变量c:/python/Script。2.7版本需要自行下载安原创 2016-03-16 19:23:38 · 271 阅读 · 0 评论