
python
python学习
Qin1999
这个作者很懒,什么都没留下…
展开
-
使用python爬虫爬取秒懂百科的视频
from urllib.parse import quotefrom bs4 import BeautifulSoupimport requestsimport re#抓取secondId的头header={'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;...原创 2019-02-04 13:43:15 · 1901 阅读 · 1 评论 -
error ‘CV_BGR2RGB’ was not declared in this scope
参考链接:error: ‘CV_BGR2RGB’ was not declared in this scopeC++ OpenCV cvtColor CV_BGR2GRAY未声明的标识符的解决办法(四)错误如下:我的解决方法:直接在main.cpp文件里面加一句#include <opencv2/imgproc/types_c.h>原因是第一个链接说缺lopencv_...原创 2019-04-26 23:29:30 · 9356 阅读 · 4 评论 -
python之pdf分页
这是最开始的我输入的文件python代码如下import osfrom PyPDF2 import PdfFileReader, PdfFileWriter#参数pdf文件位置 页数大小def pdfPageingAndSize(filePath,pageSize=1): fileDir,fileName=os.path.split(filePath) f...原创 2019-05-30 22:34:24 · 2742 阅读 · 2 评论 -
python之pdf合并
有一个朋友向我提到了pdf合并的事情。在我印象中python可以处理pdf。于是故事就开始了。下面这是搬砖行为。参考链接:Python之合并PDF文件1. 输出文件2. python代码import osfrom PyPDF2 import PdfFileReader, PdfFileWriter# 文件路径 输出文件名def pdfUnit(filePat...原创 2019-05-30 23:06:01 · 478 阅读 · 1 评论 -
python之折半查找算法
折半查找算法也叫二分查找算法。这里必须基于查找的数据是有序的,然后该算法是没有意义的。我觉得代码比较直观,所以我就直接给出代码了。折半查找非递归算法#折半查找非递归算法#折半查找函数#参数 数组 起始位置 结束位置 数据def search(arr,start,end,data): while(start<=end): half=int((star...原创 2019-06-01 16:53:06 · 5315 阅读 · 4 评论