Python拷贝文件脚本

Posted 开始认识

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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()

以上是关于Python拷贝文件脚本的主要内容,如果未能解决你的问题,请参考以下文章