当前位置:网站首页>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)
边栏推荐
- tensor中的append应该如何实现
- Sqlserver row to column pivot
- Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
- Destroy the session and empty the specified attributes
- Pytest (6) -fixture (Firmware)
- labelimg生成的xml文件转换为voc格式
- C language beginner level - pointer explanation - paoding jieniu chapter
- I2C 子系統(四):I2C debug
- I2C 子系统(二):I3C spec
- As a leader, how to control the code version and demand development when the epidemic comes| Community essay solicitation
猜你喜欢

Le processus de connexion mysql avec docker

Check log4j problems using stain analysis

I2C subsystem (III): I2C driver
![[Chongqing Guangdong education] cultural and natural heritage reference materials of China University of Geosciences (Wuhan)](/img/19/815e7cba81f6eb52db5ef0db556dfd.jpg)
[Chongqing Guangdong education] cultural and natural heritage reference materials of China University of Geosciences (Wuhan)

Spark on yarn资源优化思路笔记

Left connection, inner connection

分布式事务

vfork执行时出现Segmentation fault

Installation and use of memory leak tool VLD

I2C 子系统(二):I3C spec
随机推荐
你真的懂继电器吗?
内存泄漏工具VLD安装及使用
TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
Agile certification (professional scrum Master) simulation exercises
Variable declarations following if statements
MySql实战45讲【行锁】
Last update time of all sqlserver tables
模糊查询时报错Parameter index out of range (1 > number of parameters, which is 0)
js根据树结构查找某个节点的下面的所有父节点或者子节点
MySql实战45讲【事务隔离】
模糊查詢時報錯Parameter index out of range (1 > number of parameters, which is 0)
从输入URL到页面展示这中间发生了什么?
模型转换onnx2engine
基于Qt的yolov5工程
Anhui University | small target tracking: large-scale data sets and baselines
How to limit the size of the dictionary- How to limit the size of a dictionary?
Force deduction ----- the minimum path cost in the grid
Sqlserver row to column pivot
Joking about Domain Driven Design (III) -- Dilemma