随笔分类 -  python

摘要:platform #获取操作系统的信息 argparse #内置的一个用于命令项选项与参数解析的模块 阅读全文
posted @ 2021-06-18 13:56 左岸丶 阅读(27) 评论(0) 推荐(0) 编辑
摘要:https://docs.python.org/zh-cn/3/library/ 阅读全文
posted @ 2021-06-09 17:22 左岸丶 阅读(31) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/sinat_38682860/article/details/84350396 阅读全文
posted @ 2021-06-09 16:53 左岸丶 阅读(101) 评论(0) 推荐(0) 编辑
摘要:pip [-h,--help] pip install 包名 pip install 包名==版本号 #如果不知道版本号,输入一个错误的或者留空,就能在报错信息中看见版本号 pip uninstall 包名 pip list pip list --outdated #列出过期的包 pip show 阅读全文
posted @ 2021-06-09 16:52 左岸丶 阅读(61) 评论(0) 推荐(0) 编辑
摘要:python包自我理解 1、python包 ​ 文件夹下有__init__.py文件,这个文件夹就是一个包,(.py文件为模块) ​ 可以通过imort包名(也就是文件夹名称)导入包,当执行import包名时python会加载__init__.py文件 ​ 可以在__init__.py文件指定导入的 阅读全文
posted @ 2021-06-07 10:10 左岸丶 阅读(63) 评论(0) 推荐(0) 编辑
摘要:pydoc pydoc是python自带的一个文档生成工具,使用pydoc可以很方便的查看类和方法结构 python -m pydoc -p 1234 python -m pydoc表示打开pydoc模块,pydoc是查看python文档的首选工具; -p 1234表示在1234端口上启动serve 阅读全文
posted @ 2021-03-04 13:52 左岸丶 阅读(213) 评论(0) 推荐(0) 编辑
摘要:python编码规范PEP8 Autopep8是一个将python代码自动编排的一个工具,它使用pep8工具来决定代码中的那部分需要被排版,Autopep8可以修复大部分pep8工具中报告的排版问题。 安装方式pip install autopep8 vscode快捷键ALt+Shift+F,如果没 阅读全文
posted @ 2020-11-27 18:11 左岸丶 阅读(212) 评论(0) 推荐(0) 编辑
摘要:Python函数的4种传值的方式param,param=value,*param,**param 必选传参param # 必选参数 func(param): # 1、定义函数时的参数个数,顺序已定义好,在调用函数调时的参数个数、顺序必须一致,不能多,也不能少,也不能乱(和之前的顺序一致),因此叫必选 阅读全文
posted @ 2020-11-05 17:28 左岸丶 阅读(1980) 评论(0) 推荐(0) 编辑
摘要:UnitTest 参数化ddt,paramunittest ddt import unittest import ddt # from ddt import ddt,data,unpack,file_data @ddt.ddt class Testwork(unittest.TestCase): @ 阅读全文
posted @ 2020-11-05 17:09 左岸丶 阅读(236) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/mieleizhi0522/article/details/82142856/ 阅读全文
posted @ 2020-09-27 15:45 左岸丶 阅读(60) 评论(0) 推荐(0) 编辑
摘要:Python中os与sys两模块的区别 os与sys模块的官方解释如下: os: This module provides a portable way of using operating system dependent functionality. 这个模块提供了一种方便的使用操作系统函数的方 阅读全文
posted @ 2020-09-21 14:37 左岸丶 阅读(255) 评论(0) 推荐(0) 编辑
摘要:import sys,os sys.path.append(os.getcwd()) #将当前工作目录加入path #sys.path.append:添加环境变量 #os.getcwd:返回当前工作目录(注意是工作目录cwd哦) import sys,os sys.path.append(os.pa 阅读全文
posted @ 2020-09-21 14:32 左岸丶 阅读(4044) 评论(0) 推荐(0) 编辑
摘要:Pytest插件 插件列表网址:https://plugincompat.herokuapp.com,包含了很多插件包 一、调整测试用例的执行顺序 安装:pip install pytest-ordering 在测试方法上加下面装饰器 @pytest.mark.last #最后一个执行 @pytes 阅读全文
posted @ 2020-09-20 15:02 左岸丶 阅读(267) 评论(0) 推荐(0) 编辑
摘要:pytest 6.0.2 一、Pytest运行方式 测试类主函数模式 import pytest if __name__ == "__main__": pytest.main() #自动搜寻所有目录下的适合文件并执行 pytest.main(['./scripts/']) #指定目录 pytest. 阅读全文
posted @ 2020-09-20 11:23 左岸丶 阅读(236) 评论(0) 推荐(0) 编辑
摘要:UnitTest 单元测试框架,使用时需要导入unitest,所有测试类需要继承unittest.TestCase import unittest class Test_A(unitest.TestCase): def test_01(self): print('test_01') if __nam 阅读全文
posted @ 2020-09-12 15:53 左岸丶 阅读(142) 评论(0) 推荐(0) 编辑
摘要:datetime模块是time模块的进一步封装,对用户更加友好,在时间各属性的获取上回更加方便一些,当然,在效率上会略微低一些 https://www.cnblogs.com/chenhuabin/p/10099766.html 阅读全文
posted @ 2020-09-12 15:32 左岸丶 阅读(208) 评论(0) 推荐(0) 编辑
摘要:可以通过国内镜像进行下载 直接在pip install 加入镜像地址 例如:pip3 install django -i https://pypi.tuna.tsinghua.edu.cn/simple 设置超时时间 列如:pip3 install django --default-timeout= 阅读全文
posted @ 2020-09-12 13:20 左岸丶 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Selenium WebDriver 目录Selenium WebDriver一、浏览器操作方法二、选择器三、元素操作方法四、鼠标操作五、键盘操作六、元素等待七、下拉框八、弹窗九、frame十、窗口十一、cookie十二、JS十三、WebDriver下载地址 一、浏览器操作方法 from selen 阅读全文
posted @ 2020-09-06 20:04 左岸丶 阅读(294) 评论(0) 推荐(0) 编辑
摘要:Python入门之类(class) 阅读全文
posted @ 2020-08-16 13:41 左岸丶 阅读(114) 评论(0) 推荐(0) 编辑
摘要:import pandas as pdimport os#获取exclexcl_files = []path = os.getcwd()print(path)files = os.listdir(path)print(files)for file in files: # print(file.spl 阅读全文
posted @ 2020-07-14 17:19 左岸丶 阅读(372) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示