Advertisement

Python如何将目录复制到指定位置

  • 5星
  •     浏览量: 0
  •     大小:None
  •      文件类型:None


简介:
本文介绍在Python中使用shutil模块将整个目录复制到指定路径的方法和实例代码。适合编程爱好者学习参考。 本段落分享了使用Python将一个目录复制到指定位置的具体代码示例。 ```python import os import time copyFileCounts = 0 def copyFiles(sourceDir, targetDir): global copyFileCounts print (sourceDir) print(u%s 当前处理文件夹%s已处理%s 个文件 % (time.strftime(%Y-%m-%d %H:%M:%S, time.localtime(time.time())), sourceDir,copyFileCounts)) ``` 注意:上述代码中的`copyFileCo`似乎存在拼写错误,应该是`copyFileCounts`。

全部评论 (0)

还没有任何评论哟~
客服
客服