阅读背景:

Python:重命名文件夹的前5个文件

来源:互联网 

I dont know if this can be done or not, but is there a way that I can rename only the first 5 files in a folder? I know that I can use the os.listdir() or os.walk() to walk through the entire folder, but I only need to rename the first 5 files. I am able to use a Regex to match the files, but the problem is is that there are other files that match the same Regex. Does anyone have any suggestions? The file name takes the form of "Test Run 1 4-29-2016 2 07 56 PM". I dont know if this can be done or not, but is




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: