how to copy a file in python 3f

Solutions on MaxInterview for how to copy a file in python 3f by the best coders in the world

showing results for - "how to copy a file in python 3f"
Leon
05 Jan 2021
1# Copy a file in Python using  copy() method
2import shutil
3shutil.copy( '/src/test/source.txt' , '/dest/destination.txt' )
Syrine
09 Apr 2017
1# Copy a file in Python using  copyfile() method
2import shutil
3shutil.copyfile( 'source.txt' , 'destination.txt' )
Riccardo
23 Sep 2016
1# Copy a file in Python using  copy2() method
2import shutil
3shutil.copy2( '/src/test/source.txt' , '/dest/destination.txt' )
Fátima
22 Jan 2019
1━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2Function              preserves     supports          accepts     copies other
3                      permissions   directory dest.   file obj    metadata  
4――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
5shutil.copy                                            ☐           ☐
6shutil.copy2                                           ☐           
7shutil.copyfile          ☐             ☐                 ☐           ☐
8shutil.copyfileobj       ☐             ☐                            ☐