python
「已注销」
这个作者很懒,什么都没留下…
展开
-
Python Behave框架的入门使用
项目文件结构如下如果使用中文,需要在feature文件头部加上language注释# language: zh-CN功能: 测试数字加法计算结果正确 场景: 验证计算结果 假如 输入50 输入50 那么 结果是 100python文件要加上utf-8注释,语句字符串前要加u,否则会报错# coding:utf-8from behave import *from assertpy import assert_that@given(u"输入{n1} 输入{n2}"原创 2021-08-30 18:26:25 · 977 阅读 · 0 评论 -
python列表的正确复制方法
原文地址原创 2021-07-21 10:51:12 · 158 阅读 · 0 评论 -
使用Tesseract-OCR + pytesseract进行自动化测试截图的文字识别,获取测试数据结果
下载Tesseract-OCR并且安装配置路径下载地址pip install pytesseract代码如下:from PIL import Imagefrom pytesseract import *def img_ocr(img_path): pic = Image.open(img_path) pic_gray = pic.convert("L") pic_gray.show() text = image_to_string(pic_gray) .原创 2021-06-08 15:24:35 · 342 阅读 · 0 评论 -
python使用gitPython时报错git.exc.GitCommandNotFound的解决方法
官方的解释:git.exc.GitCommandNotFound(命令,原因)如果在PATH或GIT_PYTHON_GIT_EXECUTABLE环境变量给定的路径中找不到git可执行文件,则抛出该异常 def git_cmd(self, working_dir, command): """执行git cmd命令""" exec_res = Git(working_dir).execute(command=command) return exec_r原创 2020-10-27 20:52:42 · 4954 阅读 · 3 评论 -
解决uWSGI部署Django项目static路径静态文件丢失报错404
因为项目是前后端分离的,后端django,前端vue,在settins.py配置文件中静态路径配置如下:STATICFILES_DIRS = [ os.path.join(BASE_DIR, "fe/dist/static")]则在uwsgi的配置文件mysite.ini中加入static-map选项,其后参数为静态文件路径[uwsgi]http = 192.168.9.28:8089# socket = 192.168.12.130:8088chdir = /home/zhaobl原创 2020-10-23 11:24:55 · 2155 阅读 · 1 评论 -
【python】python移除文件操作方法
os.remove(‘文件路径’)原创 2020-10-19 20:35:58 · 126 阅读 · 0 评论