Plutonic Rainbows

Copying Again

A simple script that just checks the file size and copies the file to a target destination that you specify. That’s done when you pass in script, file_from, file_to = argv at the very beginning.

from sys import argv

script, file_from, file_to = argv

file_in = open(file_from)
indata = file_in.read()

print "The file called '%s'is %r bytes in length" % (file_from, len(indata))

file_out = open(file_to, 'w')
file_out.write(indata)

file_in.close()
file_out.close()