python中如何实现对文件的复制粘贴

更新时间:02-03 教程 由 花栀 分享

python中如何实现对文件的复制粘贴?

用shutil模块#!/usr/bin/env python#-*- coding: utf-8 -*-import osimport os.pathfrom shutil import copydest_dir = ur'd:\新建文件夹'if not os.path.isdir(dest_dir): os.makedirs(dest_dir)file_path = ur'c:\123\1.txt'copy(file_path, dest_dir)

声明:关于《python中如何实现对文件的复制粘贴》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2190558.html