05 2022 档案
摘要:①创建项目:django-admin startproject DL ②创建app:python manage.py startapp myapp ③启动服务:python manage.py runserver 0.0.0.0:80 按照上面的操作,启动服务时一直提示找不到我新建的myapp项目,
阅读全文
摘要:①通过xlutils在已有表中写数据(这种方法会改变excel的样式) import xlrd,xlwt from xlutils.copy import copy 将已存在的Excel表格赋值给变量 excel_file = xlrd.open_workbook("准备导入的资产.xls") 复制
阅读全文
摘要:--需要先安装pytest 【1】数据驱动@pytest.mark.parametrize: @pytest.mark.parametrize只对于同一用例不同数据的传参 ①只有一个参数时 datatest04=['zhangsan','lisi'] @pytest.mark.parametrize
阅读全文
摘要:# coding:utf-8 class point: def __init__(self,x,y,name): self.x = x self.y = y self.name = name '''两点距离公式''' def distance(self,p2): self.d=((self.x-p2
阅读全文
摘要:在pycarm中我们用了pytest或unittest框架写测试用例,我们如果我们在最后加上if name == 'main':,如以下代码所示。最后我们右键点击运行的时候是不会执行**if name == 'main': 里面的语句的。 点击查看代码 # coding:utf-8 import p
阅读全文
摘要:①字典中嵌套字典 res1={'content': {'age': '47岁', 'ageOne': 47, 'ageOneUnit': '1', 'ageTwo': '8', 'ageTwoUnit': '2', 'birthCode': '', 'birthday': '1974-09-09 0
阅读全文
摘要:①首先需要安装xlwt插件 安装语句:pip install xlwt ②python代码 1 import xlwt 2 ''' 3 调用xlwt模块中的Workbook方法来创建一个excel表格类型文件,编码类型为utf-8 4 ''' 5 book = xlwt.Workbook(encod
阅读全文
摘要:①首先查看数据库服务端的版本: 查询的SQL:SELECT * FROM V$VERSION ②安装客户端 根据服务端的位数版本安装客户端 我本地安装客户端的地址为:D:\PLSQL\instantclient_11_2\instantclient_11_2 ③python安装cx_Oraclel
阅读全文
摘要:请求时提示:{"content":null,"errorCode":"000001","errorMsg":"syntax error, expect {, actual ident, pos 0","status":"ERROR"}按照下面备注处理即可 def run_main(self, met
阅读全文
摘要:json.dumps() 将python对象编码成Json字符串 json.loads() 将Json字符串解码成python对象 json.dump() 将python中的对象转化成json储存到文件中 json.load() 将文件中的json的格式转化成python对象提取出来
阅读全文
摘要:from PySide2.QtWidgets import QApplication, QMessageBox,QPlainTextEdit from PySide2.QtUiTools import QUiLoader from PySide2.QtCore import QFile from P
阅读全文