【发布时间】:2015-07-23 21:47:39
【问题描述】:
如何使用 Python 将工件从 Jenkins 构建下载到本地计算机?
【问题讨论】:
标签: python-2.7 jenkins jenkins-plugins
如何使用 Python 将工件从 Jenkins 构建下载到本地计算机?
【问题讨论】:
标签: python-2.7 jenkins jenkins-plugins
我假设你想通过 http 下载。
例如,您可能想使用 GNU wget,但如果您真的想使用 Python,请查看 How do I download a file over HTTP using Python?。 Urllib2 提供了一种简单的方式来处理 http 请求。
这意味着您无需执行任何其他操作即可获取文件(身份验证等)。
【讨论】:
Traceback (most recent call last): File "C:/Python27/url_doenlaod.py", line 3, in <module> raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 403: Forbidden