你好,我只是想把一个目录复制到同一台windows机器上的另一个目录。这段代码运行没有任何错误,但我到了目录,它从来没有复制它。这是我的密码。有什么想法吗?你知道吗
import File
from distutils.dir_util import copy_tree
if __name__ == "__main__":
sourceFolder = File.File
targetFolder = File.File
sourceFolder.filePath = 'C:\\Workspace\\PythonAutomation\\1-DEV\\PythonAutomation'
targetFolder.filePath = 'C:\\Workspace\\PythonAutomation\\2-QA'
copy_tree(sourceFolder.filePath, targetFolder.filePath)
编辑: 注意,dir中的内容是python脚本和visualstudio解决方案。这就是问题所在吗?复制树只能复制某些文件类型吗?你知道吗
基本上是这样的。因为你给了一个单一的,可变的对象(我猜这是一个类定义,但它不一定是)多个名字,通过一个名字改变它通过所有名字改变它。你知道吗
这在功能上与简单情况相同:
相关问题 更多 >
编程相关推荐