Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python copy file to another directory

import shutil
shutil.copy2('/src/dir/file.ext', '/dst/dir/newname.ext') # complete target filename given
shutil.copy2('/src/file.ext', '/dst/dir') # target filename is /dst/dir/file.ext
Comment

copy directory from one location to another python

# Source path 
src = 'C:/Users / Rajnish / Desktop / GeeksforGeeks / source'
   
# Destination path 
dest = 'C:/Users / Rajnish / Desktop / GeeksforGeeks / destination'
   
# Copy the content of 
# source to destination 
destination = shutil.copytree(src, dest) 
Comment

PREVIOUS NEXT
Code Example
Python :: with in python 
Python :: django set random password 
Python :: change xlabel rotate in seaborn 
Python :: python to run another code on timer while a separate code runs 
Python :: como transformar texto a audio y reproducirlo en pyrthon 
Python :: pandas filter with given value 
Python :: pythn programme for adding user unputs 
Python :: softmax function python 
Python :: xgboosat save_model 
Python :: loss funfction suited for softmax 
Python :: python how to print input 
Python :: generate unique id from given string python 
Python :: count a newline in string python 
Python :: pandas index between time 
Python :: python ordereddict reverse 
Python :: how to count the occurrence of a word in string python 
Python :: pygame window at center 
Python :: pandas merge python 
Python :: make white image numpy 
Python :: randint python 
Python :: version python 
Python :: split string in python 
Python :: python expressions 
Python :: python cv2 convert image to binary 
Python :: string to binary python 
Python :: python convert multidimensional array to one dimensional 
Python :: linked lists python 
Python :: install opencv for python 2.7 
Python :: convert float to int python 
Python :: data structures and algorithms in python 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =