python重命名文件源码
把写内容过程中比较重要的内容做个收藏,下面的内容段是关于python重命名文件的内容。
import oscur_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)
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。