当前位置:网站首页>Batch import of pictures into WPS table by date
Batch import of pictures into WPS table by date
2022-06-28 06:24:00 【The king's Lamb】
List of articles
Get the creation date of pictures in batch
import os
import time
import xlsxwriter
path = "testpic"
file = ' data ' + '.xlsx' # Save table name
i=1
workbook = xlsxwriter.Workbook(file)
worksheet = workbook.add_worksheet('sheet1')
list =os.listdir(path)
for pic in list:
timeStamp=os.path.getmtime(r"F:\Python\testpic\%s"%pic)
timeArray = time.localtime(timeStamp)
otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
worksheet.write(f'A{
i}',otherStyleTime)
i+=1
workbook.close()
The test image 
Get the creation time and fill in the table 
Batch import pictures
import xlsxwriter
import os
file = 'importpicure' + '.xlsx' # Save table name
list =os.listdir("testpic")
print(list)
i=1
workbook = xlsxwriter.Workbook(file)
worksheet = workbook.add_worksheet('sheet1')
for pic in list:
worksheet.insert_image(f'A{
i}', f'testpic/{
list[i-1]}',{
'x_scale': 0.0705, 'y_scale': 0.1015, 'x_offset': 0, 'y_offset': 0}) # Appoint A Column ,x、y Scale to
i=i+1
workbook.close()
Final rendering

【 Reference material 】
python System path placeholder timeStamp=os.path.getmtime(r"F:\Python\testpic\%s"%pic)
python Use xlsxwriter Circular direction excel The operation of inserting data and pictures in
python Convert timestamp to time _Python The conversion between time stamp and date
边栏推荐
- Independent station sellers are using the five e-mail marketing skills, do you know?
- 移动广告发展动向:撬动存量,精细营销
- ImportError: cannot import name 'ensure_ dir_ Possible solutions for exists'
- Use of JDBC
- Iframe switching in Web Automation
- Socket. Io long Connection Push, version Control, Real - Time Active user volume Statistics
- ROS rviz_satellite功能包可视化GNSS轨迹,卫星地图的使用
- Alibaba cloud SMS service (Complete Guide), SMS sending function implementation.
- Alert pop-up processing in Web Automation
- Exception handling (I) -- null pointer and array index out of bounds
猜你喜欢

Slow content advertising: the long-term principle of brand growth

Xcode13.3.1 项目执行pod install后报错

ROS rviz_ Satellite function package visualizes GNSS track and uses satellite map

Online facing such an online world, the only limitation is our imagination

death_ satan/hyperf-validate

Oracle condition, circular statement

JDBC学习(一)——实现简单的CRUD操作

JSP

搭建你jmeter+jenkins+ant

death_satan/hyperf-validate
随机推荐
socke. IO long connection enables push, version control, and real-time active user statistics
[untitled]
AutoCAD C polyline self intersection detection
AutoCAD C# 多段線小銳角檢測
How popular are FB and WhatsApp mass messages in 2022?
CAD二次开发+NetTopologySuite+PGIS 引用多版本DLL问题
Socket. Io long Connection Push, version Control, Real - Time Active user volume Statistics
Idea automatically adds comments when creating classes
MySQL common functions
death_satan/hyperf-validate
socke.io長連接實現推送、版本控制、實時活躍用戶量統計
AutoCAD C# 多段线自相交检测
CAD secondary development +nettopologysuite+pgis reference multi version DLL
Build your jmeter+jenkins+ant
不会还有人只会用forEach遍历数组吧?
移动广告发展动向:撬动存量,精细营销
Caused by: com. fasterxml. jackson. databind. Exc.invalidformatexception: exception resolution
Teach you how to use UCOS
ROS rviz_ Satellite function package visualizes GNSS track and uses satellite map
JQ picture amplifier