首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

python拷贝资料

2012-09-09 
python拷贝文件import shutil, errnodef copyanything(src, dst):try:shutil.copytree(src, dst)except OS

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

?

?

热点排行