python知识积累

时间:2024-01-18 13:19:20

python数据结构与算法https://www.yiibai.com/python/py_data_structure/python_data_structure_introduction.html

1.

安装requirements.txt依赖:

pip install -r requirements.txt

生成requirements.txt文件:

pip freeze > requirements.txt

2.

No module named 'HTMLTestRunner

从 http://tungwaiyip.info/software/HTMLTestRunner.html 下载HTMLTestRunner.py

修改HTMLTestRunner.py

第94行 StringIO 改成 io

第539行 self.outputBuffer = StringIO.StringIO() 要改成self.outputBuffer = io.BytesIO()

第642行,将if not rmap.has_key(cls):修改成if not cls in rmap:

第766行,将uo = o.decode(‘latin-1‘)修改成uo = e
第766行,将uo = o.decode(‘latin-1‘)修改成uo = e
第775行,将ue = e.decode(‘latin-1‘)修改成ue = e
第631行,将print >> sys.stderr, ‘\nTime Elapsed: %s‘ %(self.stopTime-self.startTime)修改成print(sys.stderr, ‘\nTimeElapsed: %s‘ % (self.stopTime-self.startTime))

引用https://blog.csdn.net/weixin_38532008/article/details/80950107

3.

PyCharm IDE环境下,执行unittest不生成测试报告问题解决
https://blog.csdn.net/alchaochao/article/details/79630830

4.

Ubuntu下将PyCharm锁定到启动项

https://blog.csdn.net/Counting_Stars/article/details/80647770

5.

pyenv versions

查看当前系统中包含的Python版本

pyenv global  xxx

选择不同的Python版本

6.python加速小技巧

参考:https://www.jb51.net/article/162967.htm