Python拷贝文件脚本

author : headsen chen

date : 2018-12-06  17:56:58

copy_file.py

#!/usr/bin/env python
from sys import argv
from os.path import exists

script,from_file,to_file=argv

print("Copying from %s to %s" %(from_file,to_file))
inputt = open(from_file)
indata= inputt.read()
output = open(to_file,'w')
output.write(indata)
output.close()
inputt.close()
posted @ 2018-12-06 17:57  开始认识  阅读(1022)  评论(0编辑  收藏  举报