随笔分类 - python
摘要:https://zhuanlan.zhihu.com/p/490353142 1. 进程vs线程 进程(process)指的是正在运行的程序的实例,即an instance of a computer that is being executed。用拆字法理解就是:进行中的程序。程序是一个没有生命的
阅读全文
摘要:request random os sys re subprocess logging time
阅读全文
摘要:time1 = '2021-05-10 18:44:36'time2 = '2021-05-10 17:44:36'time3 = '2021-05-10 17:50:36'timelist = []timelist.append(time1)timelist.append(time2)timeli
阅读全文
摘要:1 parametrize参数化实质上是DDT,即数据驱动测试,下面首先看下不用数据驱动的方式 在test_example.py 文件中编写如下代码: def add(a,b): return (a+b) def test_1(): assert add(3,5)==8 def test_2():
阅读全文
摘要:王会喜 常见python面试题-手写代码系列 1.如何反向迭代一个序列 #如果是一个list,最快的方法使用reversetempList = [1,2,3,4]tempList.reverse()for x in tempList: print x #如果不是list,需要手动重排templist
阅读全文
摘要:pip install numpy 时 报错: Traceback (most recent call last): File "d:\python\lib\site-packages\pip\_vendor\urllib3\response.py", line 437, in _error_cat
阅读全文