File input/output: Difference between revisions

m
Line 798:
 
 
The following use of the standard libraries shutil.copyfile is to be preferred. (Current source code ensures that failure to open files raises appropriate exceptions, a restricted buffer is used to copy the files using binary mode, and any used file descriptors are always closed).
<python>import shutil
shutil.copyfile('input.txt', 'output.txt')</python>
Anonymous user