安全问答

安全问答是一个知识全球问答,包含丰富的问答知识

首页 常规 游戏 娱乐 科技 程序员

Python 代码:批量替换文件名中的 '+' 为 ':'

  • 日期: 2025-04-09
  • 标签: 常规
import os

folder_path = r'C:\Users\Administrator\Desktop\xuexi'

for root, dirs, files in os.walk(folder_path):
    for file in files:
        old_name = os.path.join(root, file)
        new_name = os.path.join(root, file.replace('+', ':'))
        os.rename(old_name, new_name)
Python 代码:批量替换文件名中的 '+' 为 ':'

原文地址: https://www.cveoy.top/t/topic/m0wt 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录

  • 上一篇: 人工智能领域顶尖实验室和公司:OpenAI、Hugging Face、Google Brain 等
  • 下一篇: International Business Negotiations: Challenges in Asset Transfer Across Borders

© 2019 • 2025 - 安全问答 站长邮箱:wxgpt@qq.com    ICP备案/许可证号:鲁ICP备2026057792号