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 :: python jwt parse 
Python :: generate random string python 
Python :: extract numbers from string python 
Python :: python print float with 2 decimals 
Python :: string with comma to int python 
Python :: python get ros package path 
Python :: how to migrate from sqlite to postgresql django 
Python :: list of prime numbers in python 
Python :: anaconda python update packages 
Python :: make dataframe from list of tuples 
Python :: valueerror expected 2d array got 1d array instead python linear regression 
Python :: how to remove coma in python 
Python :: count similar values in list python 
Python :: order pandas dataframe by column values 
Python :: get active window title python 
Python :: cv display image in full screen 
Python :: how to convert dataframe to list in python 
Python :: get size of window tkinter 
Python :: how to make a python program to count from 1 to 100 
Python :: easiest way to position labels in tkinter 
Python :: train_test_split without shuffle 
Python :: how to maker loops coun t in second in pytho 
Python :: convert unix timestamp to datetime python pandas 
Python :: scikit learn r2 score 
Python :: df shift one column 
Python :: python minute from datetime 
Python :: python play mp3 in background 
Python :: change dataframe column type 
Python :: selenium current url 
Python :: python ceiling 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =