Look for a directory in SVN for files with a specific file extension and copy to another folder?

I want my python script to search a directory in SVN, find files ending with a specific extension (e.g. * .exe), and copy those files to the directory that was created on my C drive, How can I do this? I'm new to Python, so a detailed answer and / or point in the right direction would be much appreciated.

Follow-up: When using os.walk, what parameter should I pass to make sure I copy files with a specific extension (eg. * .Exe)?

+1


source to share


1 answer


I think the easiest way to check (or, better, export) the source tree is with the svn command line utility: you can use os.system to invoke it. There are also direct Python-to-svn API bindings, but I would advise them not to use them if you are new to Python.



Then you can move the checkout folder eg. using os.walk; the copy itself can be done with shutil.copy.

+1


source







All Articles