读书人

python拷贝资料

发布时间: 2012-09-09 09:27:54 作者: rapoo

python拷贝文件

import shutil, errnodef copyanything(src, dst):    try:        shutil.copytree(src, dst)    except OSError as exc: # python >2.5        if exc.errno == errno.ENOTDIR:            shutil.copy(src, dst)        else: raise
?

代码来源:

http://stackoverflow.com/questions/1994488/copy-file-or-directory-in-python

?

还可以看看这个:

http://stackoverflow.com/questions/123198/how-do-i-copy-a-file-in-python

?

?

读书人网 >perl python

热点推荐