Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

copy content from one file to another in python

import shutil
shutil.copyfile('file.txt','file-copy.txt') # Copy contents alone
shutil.copy('file.txt','file-copy.txt') # Copy content and permission
shutil.copy2('file.txt','file-copy.txt') #Copy content, permission and metadata
 
PREVIOUS NEXT
Tagged: #copy #content #file #python
ADD COMMENT
Topic
Name
8+6 =