Batch modify the same string in file name
#!/usr/bin/env python
#-*- coding:utf8 -*-
import os
#获得文件夹下文件名列表
file_path=r"H:\1、Work related\app分析范例 (1)\pkts\05084-line"
file_list=os.listdir(file_path)
#选择要重命名的文件夹路径
os.chdir(file_path)
#使用replace替换文件名中要替换的内容
for file in file_list:
os.rename(file,file.replace("_安卓_","_android_"))