用到了os的两个接口:1、列出文件夹中的所有文件(也包含目录)os.listdir(path)Return a list containing the names of the entries in the directory given by path. The list is in arbitrary order. It does not include the special entries ‘.’ and ‘..’ even if they are present in the directory.Availability: Unix, Windows.Changed in version 2.3: On Windows NT/2k/XP and Unix, if path is a Unicode object, the result will be a list of Unicode objects. Undecodable filenames will still be returned as string objects2、对文件进行重命名os.rename(src, dst)Rename the file or directory src to dst. If dst is a directory, OSError
...
继续阅读
(67)