Palmbomen II - Memories of Cindy
January 26, 2018
Listening to this new album today while I try and understand how Python calculates a file size and then copies it to another file.
from sys import argv
from os.path import exists
script, from_file, to_file = argv
print "Copy the %s file to the %s file." % (from_file, to_file)
#get file size
in_file = open(from_file)
indata = infile.read()
print "The file size is %d bytes." % len(indata)
print "Ok. Does the output file exist? %r" % exists (to_file)
print "Hit return."
out_file = open(to_file, 'w')
outfile.write(indata)
out_file.close()
in_file.close()
Recent Entries
- Wonder 2 Finally Shows Some Restraint January 25, 2026
- Forty-Five Bugs Hiding in Plain Sight January 23, 2026
- Cleaning the Metadata January 21, 2026