Python
张明云
纸上得来终觉浅,绝知此事要躬行。
展开
-
Windows系统下Python压缩和解压文件、文件夹操作
# coding:UTF-8import zipfile,os#把整个文件夹内的文件打包path = 'G:\\BaiduMusic\\Images\\'zipName = path + 'BaiduMusic_Image.zip'f = zipfile.ZipFile( zipName, 'w', zipfile.ZIP_DEFLATED )for dirpath, dirnam原创 2014-01-15 10:15:03 · 12049 阅读 · 0 评论 -
Python批量重命名
#coding=UTF-8import os#执行重命名功能path = 'G:\\BaiduMusic\\Images'for file in os.listdir(path): if os.path.isfile(os.path.join(path,file))==True: newname = file.replace("test","image")原创 2014-01-16 09:08:53 · 4765 阅读 · 0 评论