copy file in python3
import shutil
original = r'original path where the file is currently stored\file name.file extension'
target = r'target path where the file will be copied\file name.file extension'
shutil.copyfile(original, target)
copy file in python3
import shutil
original = r'original path where the file is currently stored\file name.file extension'
target = r'target path where the file will be copied\file name.file extension'
shutil.copyfile(original, target)
How to Copy a File in Python?
# Copy a file in Python using copyfile() method
import shutil
shutil.copyfile( 'source.txt' , 'destination.txt' )
How to Copy a File in Python?
# Copy a file in Python using copy2() method
import shutil
shutil.copy2( '/src/test/source.txt' , '/dest/destination.txt' )
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us