Q1
What is the difference between `shutil.copy()` and `shutil.copy2()`?
💬Answer
shutil.copy(src, dst): Copies the file contents and permissions. It does not preserve file metadata (like creation and modification times).shutil.copy2(src, dst): Copies the file contents, permissions, and preserves all metadata (timestamps).
Related Python Questions
View All PythonQuestions →
Created by
Apurv Gujjar
DevOps & Cloud Engineer
Specialized in:DevOpsAWSGCPKubernetesTerraformDocker
View Portfolio