ITeye博客

Python 中怎么 copy 文件和目录

cloudhe · 2008-08-15 14:20 · Python · Markdown

>>> 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')
>>>

 

From http://www.pythonid.com/html/fenleiwenzhang/normalproblem/20070705/79.html

评论(1)

  1. #1 楼 · bcw104 · 2010-05-12 16:21

    不支持中文路径

评论功能维护中,当前仅展示历史评论。