python文件拷贝copyfile

# copyfile .py

from shutil import copyfile
from sys import exit

source = 'D:\\testData\\123.png'  # 源路径
target = 'D:\\123.png'                   # 目标路径 
# adding exception handling
try:
   copyfile(source, target)            # copyfile 函数调用

except:
   print('copy file faild')

发布了13 篇原创文章 · 获赞 6 · 访问量 9394

猜你喜欢

转载自blog.csdn.net/u010843408/article/details/105356748