1 Star 0 Fork 0

wangsong/Python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ModifyFilename.py 348 Bytes
一键复制 编辑 原始数据 按行查看 历史
injetlee 提交于 2016-12-09 14:22 . 12.9
import os
dir = os.getcwd()
subdir = os.listdir(dir)
for i in subdir:
path = os.path.join(dir, i)
if os.path.isdir(path):
end_dir = os.listdir(path)
for i in range(len(end_dir)):
newname = end_dir[i][0:50]
os.rename(os.path.join(path, end_dir[
i]), os.path.join(path, newname))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wanghuan1989/Python.git
git@gitee.com:wanghuan1989/Python.git
wanghuan1989
Python
Python
master

搜索帮助