[Tutor] (no subject)

Kent Johnson kent37 at tds.net
Mon Dec 5 17:16:02 CET 2005

Roberts, Alice wrote:

> Good morning,
> Does anyone know of something that will copy a directory tree, but 
> only for files with a specific extension? I found
> *copytree*(
> /src, dst/[/, symlinks/])
> , but I wasn’t sure how to assign the src to the string, ie) 
> \\server\share\*.xls.

shutil.copytree() won't do what you want, but you might consider making 
a modified copy for your own use. It is a pretty simple function and the 
comments even encourage using it as an example to do what you want. You 
can find the source in the Lib directory of your Python installation.


More information about the Tutor mailing list