
python
天使的翅膀007
机器学习新人
展开
-
python flask多线程线程数量异常
项目场景:在flask中使用threading模块,进行多线程代码调用问题描述:flask运行后线程数目会比预期的数量多一个未知的线程import threadingimport timefrom flask import Flaskapp = Flask(__name__)global threaddef test(): while True: length = len(threading.enumerate()) print("线程数量原创 2021-04-07 09:48:52 · 1380 阅读 · 1 评论 -
ubuntu anconda环境中python3.7安装cv2及出现错误的解决办法
安装cv2pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simpleImportError: libSM.so.6: cannot open shared object file: No such file or directory退出虚拟环境,在ubuntu下使用命令i686是32位系统我们的是6...原创 2020-04-03 11:34:55 · 1445 阅读 · 0 评论 -
python random.seed()
seed()可以改变随机数生成器种子import randomrandom.seed()print('随机数1:',random.random())random.seed()print('随机数2:',random.random())random.seed(1)print('随机数3:',random.random())random.seed(1)print('随机数4:',...原创 2019-12-31 14:14:42 · 304 阅读 · 0 评论 -
python jupyter matplotlib plt.show() 图片不显示在页面上
在使用画图代码import matplotlibmatplotlib.use('Qt5Agg') from matplotlib import pyplot as plt#use()内有多个参数# [‘GTK’, ‘GTKAgg’, ‘GTKCairo’, ‘GTK3Agg’, ‘GTK3Cairo’,‘MacOSX’, ‘nbAgg’, ‘Qt4Agg’, ‘Qt4Cairo’, ...原创 2019-12-31 11:10:43 · 8270 阅读 · 1 评论