![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python-随记
billycoder
billy是个coder!
展开
-
python-图片转pdf
import osfrom fpdf import FPDFpdf = FPDF()pdf.set_auto_page_break(0) # 自动分页设为Falsepath = r"图片文件夹路劲"imagelist = [i for i in os.listdir(path)]for image in sorted(imagelist): pdf.add_page() pdf.image(os.path.join(path, image), w=190,原创 2022-03-13 14:57:33 · 1663 阅读 · 0 评论 -
python-svg转png
import cairosvgdef svg2png(svgPath,pngPath): print(svgPath+" 转为 "+pngPath) cairosvg.svg2png(url=svgPath, write_to=pngPath)原创 2022-03-13 14:39:45 · 1969 阅读 · 0 评论 -
python-svg转png-报错-AttributeError: module ‘PIL.ImageOps‘ has no attribute ‘exif_transpose‘
错误 File "D:\sdk\Anaconda3\lib\site-packages\cairosvg\image.py", line 78, in image image = ImageOps.exif_transpose(Image.open(BytesIO(image_bytes)))AttributeError: module 'PIL.ImageOps' has no attribute 'exif_transpose'解决pip install --upgrade pill原创 2022-03-13 14:38:23 · 1526 阅读 · 0 评论 -
python-python生成exe
# 当前目录# pyinstaller -F exportword.py原创 2022-02-17 19:18:08 · 641 阅读 · 0 评论 -
python 请求头字符串转字典
python 请求头字符串转字典# headerheaders_str = '''Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9Cache-Control: n原创 2021-04-12 15:19:54 · 190 阅读 · 0 评论 -
python爬取五百丁word模板(有图+有代码)
更新时间 2019年3月15日五百丁首页爬取效果python代码# -*-coding:utf-8-*-import datetimeimport jsonimport osimport threadingimport timeimport tracebackfrom queue import Queueimport requestsfrom lxml impo...原创 2019-03-15 11:18:44 · 858 阅读 · 2 评论 -
python爬取五百丁ppt模板(有图+有代码)
更新时间 2019年3月15日五百丁首页下载截图python代码# -*-coding:utf-8-*-import datetimeimport jsonimport osimport threadingimport timeimport tracebackfrom queue import Queueimport requestsfrom lxml imp...原创 2019-03-15 10:54:24 · 1863 阅读 · 3 评论 -
python爬取boss直聘岗位-写入excel(有图+有代码)
效果日志输出表格内容代码import requestsfrom bs4 import BeautifulSoupimport timeimport xlwt # 用来创建excel文档并写入数据def initRequest(): global url_pattern, headers url_pattern = 'https://www.zhipin...原创 2019-03-15 14:04:01 · 2575 阅读 · 4 评论