当前位置:网站首页>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
边栏推荐
- Deleting MySQL under Linux
- Use of JDBC
- Yygh-7-user management
- Linked list (II) - Design linked list
- Create a gson object that formats the time zone. JSON parsing time formatting zoneddatetime
- Unity packaging webgl uses IIS to solve the error
- 慢内容广告:品牌增长的长线主义
- easyui下拉框选中触发事件
- JS of learning notes -- split(), replace(), join()
- AttributeError: 'callable_iterator' object has no attribute 'next'
猜你喜欢

Yygh-6-wechat login

Build your jmeter+jenkins+ant

借助nz-pagination中的let-total解析ng-template

Exception handling (I) -- null pointer and array index out of bounds

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

Introduction to browser tools: think sky browser, team work browser

Paper recommendation: efficientnetv2 - get smaller models and faster training speed through NAS, scaling and fused mbconv

MySQL (I) - Installation

socke.io長連接實現推送、版本控制、實時活躍用戶量統計

Example of MVVM framework based on kotlin+jetpack
随机推荐
Install redis on windows and permanently change the password, and integrate redis with the SSM framework
Caused by: com. fasterxml. jackson. databind. Exc.invalidformatexception: exception resolution
Yolov5 adds a small target detection layer
JDBC learning (I) -- implementing simple CRUD operations
OpenGL API learning (2008) client server client server
socke.io長連接實現推送、版本控制、實時活躍用戶量統計
fpm工具安装
2 startup, interrupt and system call
D3D11_ Chili_ Tutorial (3): design a bindable/drawable system
API learning of OpenGL (2007) gltexcoordpointer
How to add live chat in your Shopify store?
【Paper Reading-3D Detection】Fully Convolutional One-Stage 3D Object Detection on LiDAR Range Images
浮动与定位
Sharing tips for efficient scripting
YOLOv5增加小目标检测层
JQ picture amplifier
Camx架构开UMD、KMD log以及dump图的方式
eyebeam高级设置
idea根据数据库表生成实体类
What are the advantages of e-mail marketing? Why do sellers of shopline independent station attach so much importance to it?