Manojs toppalad
Manojs toppalad

Reputation: 15

How can i copy a directory containing a particular file with particular extension in a variable in python

How can i copy a directory containing a particular file with particular extension in a variable in python Note that the file may be present in sub folder too. Since I am a beginner I would like to have some help...

Thanks in advance

Upvotes: 0

Views: 38

Answers (1)

lakeIn231
lakeIn231

Reputation: 1295

Python code for this.

from distutils.dir_util import copy_tree

fromDirectory = "/user/"
toDirectory = "/windows/"

copy_to_file(fromDirectory, toDirectory)

Upvotes: 1

Related Questions