python重命名文件源码
更新:HHH   时间:2023-1-7


把写内容过程中比较重要的内容做个收藏,下面的内容段是关于python重命名文件的内容。

import os
cur_path = os.getcwd()
lists = os.listdir( cur_path )
for f in lists:
    if f != 'ren.py':
        print cur_path
        cur_file = cur_path + '\' + f
        new_file = cur_file.replace( '副本', '' )
        os.rename(cur_file, new_file)
返回编程语言教程...