Python的shutil模块
2021/6/4 12:23:28
本文主要是介绍Python的shutil模块,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
import shutil
1.shutil.copy(source,destination)
将source的文件拷贝到destination,两个参数都是字符串格式。
2.shutil.copyfilr()
将源文件内容复制给目标文件,如果目标文件不存在则产生错误。
3.shutil.copytree(source,destination)
复制整个文件夹,从source复制到destion中,destion是不存在的文件,将source下的文件全部拷贝到destion中。
4.shutil,copy2()
和shutil.copy2()类似,但copy2拷贝过来的元数据会包含访问可修改时间。
这篇关于Python的shutil模块的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python