一、利用到的包
1、进度条:progressbar
可以用pip安装
pip install progressbar
若安装很慢,可以-i 指定镜像
pip install progressbar -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
当然进度条有一个更牛逼的,可以自己研究,地址:https://github.com/tqdm/tqdm
2、excel操作包openpyxl
pip install openpyxl
若安装很慢,可以指定镜像
pip install openpyxl -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
当然也可以用其他excel操作包,原理都一样。
二、代码
代码已经上传github 地址:https://github.com/git-tree/img2excel
喜欢的点个赞✿✿ヽ(°▽°)ノ✿!
三、运行
打开cmd控制台(windows键+R,然后输入cmd),输入 python img2excel_user.py 图片地址 excel保存地址(要加上excel名字)
如 cmd 输入运行:
python img2excel_user.py D:/test.png D:/outExcel.xlsx
四、效果图
over ✿✿ヽ(°▽°)ノ✿!