如何在Python中复制文件夹和文件
我知道使用shutil.copy(src,dst)
复制文件和shutil.copytree(src,dst)
用于复制目录。
有什么办法,所以我不必区分复制文件夹和复制文件?
tysm
I am aware that usingshutil.copy(src,dst)
copies files andshutil.copytree(src,dst)
is used for copying directories.
Is there any way so I don't have to differentiate between copying folders and copying files?
Tysm
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想看看这个主题,在这里回答了同样的问题。
https://stackoverflow.com/a/1994840/17595642
可以写入功能来做到这一点。
这是另一个主题中实现的一个:
You might want to take a look to this topic, where the same question was answered.
https://stackoverflow.com/a/1994840/17595642
Functions can be written to do so.
Here is the one implemented in the other topic :