i have this mini-script:
from __future__ import print_function
from sys import argv
from os.path import exists
p_script, p_from_file, p_to_file = argv
print ('Copying from {first} to {second}'.format(first = p_from_file,
second = p_to_file))
v_in_file = (open(p_from_file, 'r')).read()
print (v_in_file)
print ('The input file is {size} bytes long'.format(size = len(v_in_file)))
print ('Does the output file exists? {boolean}'.format(boolean = exists(p_to_file)))
raw_input('Press return to continue...')
v_out_file = open(p_to_file, 'w')
v_out_file.write(v_in_file)
print ('Alright, all done.')
v_in_file.close()
v_out_file.close()
Problem is..i can't close the file and i don't know why, what's the problem? "v_in_file.close()" doesn't executes properly.