一、利用到的包
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 ✿✿ヽ(°▽°)ノ✿!