下面的代码将重新保存目录中的所有xls文件(例如,1.xls将另存为COPY OF 1.xls)。你知道吗
import os
from shutil import copyfile
directory = "C:\\ucustom\\myfiles"
for filename in os.listdir(directory):
if filename.endswith(".xls"):
copyfile(os.path.join(directory, filename),
os.path.join(directory, "COPY OF " + filename))
下面的代码将重新保存目录中的所有
xls
文件(例如,1.xls
将另存为COPY OF 1.xls
)。你知道吗相关问题 更多 >
编程相关推荐