当前位置:网站首页>File rename
File rename
2022-07-03 03:09:00 【AphilGuo】
os.rename(ori_name, new_name)
import os
ori_path = './new_name'
folder_list = os.listdir(ori_path)
# print(folder_list)
for i in range(len(folder_list)):
folder_name = folder_list[i]
file_path = os.path.join(ori_path + '/'+ folder_name)
file_list = os.listdir(file_path)
for j in range(len(file_list)):
file_name = file_list[j]
new_name = file_name[:-5] + str(folder_name) + '-' + file_name[-5:]
ori_name = file_path + '/' +file_name
new_name = file_path + '/' +new_name
os.rename(ori_name, new_name)
边栏推荐
- docker安装redis
- 当lambda没有输入时,是何含义?
- I2C subsystem (IV): I2C debug
- [leectode 2022.2.15] lucky numbers in the matrix
- 模糊查询时报错Parameter index out of range (1 > number of parameters, which is 0)
- Check log4j problems using stain analysis
- Change cell color in Excel using C - cell color changing in Excel using C
- [Fuhan 6630 encodes and stores videos, and uses RTSP server and timestamp synchronization to realize VLC viewing videos]
- MySql实战45讲【行锁】
- I2C 子系统(一):I2C spec
猜你喜欢

Creation and destruction of function stack frame

I2C subsystem (IV): I2C debug

VS code配置虚拟环境

vfork执行时出现Segmentation fault

Three. JS local environment setup

VS 2019配置tensorRT

TCP handshake three times and wave four times. Why does TCP need handshake three times and wave four times? TCP connection establishes a failure processing mechanism
![MySQL practice 45 [SQL query and update execution process]](/img/cd/3a635f0c3bb4ac3c8241cb77285cc8.png)
MySQL practice 45 [SQL query and update execution process]

力扣------网格中的最小路径代价

Add automatic model generation function to hade
随机推荐
模糊查询时报错Parameter index out of range (1 > number of parameters, which is 0)
BigVision代码
Vs Code configure virtual environment
The base value is too large (the error is marked as "08") [duplicate] - value too great for base (error token is'08') [duplicate]
I2C subsystem (IV): I2C debug
labelimg生成的xml文件转换为voc格式
Kubernetes cluster log and efk architecture log scheme
Vs 2019 configuration du moteur de génération de tensorrt
TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
How to use asp Net MVC identity 2 change password authentication- How To Change Password Validation in ASP. Net MVC Identity 2?
Left connection, inner connection
How to limit the size of the dictionary- How to limit the size of a dictionary?
js根据树结构查找某个节点的下面的所有父节点或者子节点
【PyG】理解MessagePassing过程,GCN demo详解
Use cve-2021-43893 to delete files on the domain controller
Idea format code idea set shortcut key format code
I2C subsystem (I): I2C spec
模糊查詢時報錯Parameter index out of range (1 > number of parameters, which is 0)
后管中编辑与预览获取表单的值写法
idea 加载不了应用市场解决办法(亲测)