使用python下载文件目录的httpurl

2024-04-24 15:01:14 发布

您现在位置:Python中文网/ 问答频道 /正文

Possible Duplicate:
Looping through a directory on the web and displaying its contents (files and other directories) via Python

嗨,伙计们

如果我有代码文件

http://AAA/BBB/tags/revision/

如何用python下载这些文件?在

如果他们总共有6亿美元,有没有什么有效的方法?在


Tags: and文件theweboncontentsfilesdirectory
1条回答
网友
1楼 · 发布于 2024-04-24 15:01:14

您是否使用svn作为存储库?它看起来像这样:

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')

相关问题 更多 >