download a folder of files given the http url of the files directory with python [duplicate]
Possible Duplicate:
Looping through a directory on the web and displaying its contents (files and other directories) via Python
hi, Guys,
If I have code files under
http://AAA/BBB/tags/revision/
how can I download these files in python?
and If they have 600M in total, is there 开发者_Python百科some efficient way to do it?
Are you using svn as your repository? It would look like this:
from subprocess import Popen, PIPE
def svn_co(url):
return run_program('svn', 'co', url)
def run_program(*args):
popen_obj = Popen(args, stderr=PIPE)
_, errors = popen_obj.communicate()
if popen_obj.returncode:
print errors
# This will get all the files in myproject's tagged version
# named tagname into the current directory
svn_co('http://svn.myserver.net/myproject/tags/tagname')
精彩评论