>>> import shutil
>>> dir(shutil)
['Error', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '_samefi
le', 'abspath', 'copy', 'copy2', 'copyfile', 'copyfileobj', 'copymode', 'copysta
t', 'copytree', 'destinsrc', 'move', 'os', 'rmtree', 'stat', 'sys']
>>> shutil.copyfile('d:/c.sql','d:/cc.sql')
>>>
from http://www.pythonid.com/html/fenleiwenzhang/normalproblem/20070705/78.html
mulu:
>>> import shutil
>>> shutil.copytree('d:/test','d:/testd')
>>>
Python 中怎么 copy 文件和目录
最新推荐文章于 2024-08-20 23:08:13 发布
本文介绍了Python中shutil模块的功能及使用方法,展示了如何利用该模块进行文件和目录的复制操作,包括单个文件的复制以及整个目录树的复制。
1540

被折叠的 条评论
为什么被折叠?



