python中如何實現(xiàn)對文件的復(fù)制粘貼?
用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)