I'm trying to copy /home/myUser/dir1/
and all its contents (and their contents, etc.) to /home/myuser/dir2/
in python. Furthermore, I want the copy to overwrite everything in dir2/
.
It looks like distutils.dir_util.copy_tree
might be the right tool for the job, but not sure if there's anything easier/more obvious to use for such a simple task.
If it is the right tool, how do I use it? According to the docs there are 8 parameters that it takes. Do I have to pass all 8 are just src
, dst
and update
, and if so, how (I'm brand new to Python).
If there's something out there that's better, can someone give me an example and point me in the right direction? Thanks in advance!
所有评论(0)