python
Sarah.J
这个作者很懒,什么都没留下…
展开
-
出现“cannot identify image file ‘/Users//.DS_Store‘”解决办法
image转为PDF时遇到的报错采用的做法是 cd 到这个文件夹sudo find ./ -name ".DS_Store" -depth -exec rm {} \;原创 2021-08-08 13:44:56 · 923 阅读 · 0 评论 -
Python爬取图片后快速存储
不用再费时间另存为图片了 enn…真香import requestsimport osroot = "/Users/Downloads/yuwen/"for i in range(1,135): url = "https://ha.huatu.com/zt/dzkb/yuwen/6s/images/{}.jpg".format(i) path = root + url.split('/')[-1] try: if not os.path.exists(root)原创 2021-08-08 13:30:14 · 178 阅读 · 1 评论 -
Python 一堆图片转为PDF
废话不多说,直接上代码import osfrom fpdf import FPDFpdf = FPDF()path_picture = "/Users/pc/Downloads/yuwen/"path_docx = "/Users/pc/Downloads/yuwendoc/"imageList = [i for i in os.listdir(path_picture)]# 排序规则get_key = lambda i: int(i.split('.')[0])pdf.add_p原创 2021-08-08 13:26:35 · 117 阅读 · 0 评论 -
pyinstaller 打包时包含子文件资源
使用pyinstaller打包项目时,txt文件和img文件并没有随同打包,查阅了很多文章,发现有一位大佬写的文章解决了问题https://blog.csdn.net/polyhedronx/article/details/81740818感谢转载 2020-05-28 22:07:00 · 1579 阅读 · 0 评论 -
Selenium配合chromedriver打包为exe后运行时提示Message chromedriver executable needs to be in PATH
Selenium配合chromedriver提示“Message: ‘chromedriver’ executable needs to be in PATH使用pyinstaller打包exe文件夹后,执行程序报错,如图网上查阅了好多资料,尝试了多种办法1、chromedriver 版本是否和本机浏览器位置相同(具体对应版本请百度)2、chromedriver 放在chrome浏览器同级位置(默认安装,位置应该都相同)C:\Program Files (x86)\Google\Chrome\原创 2020-05-28 22:01:44 · 2034 阅读 · 0 评论