如何在python中从文件服务器下载和保存文件

时间:2016-03-16 01:31:17

标签: python windows request

我正在使用python并请求库。

我在Intranet文件服务器上生成了我的文件,其中包含类似

的网址
url = "\\\\int\\appdata\\test\\data.txt"

如果在浏览器中直接删除它,它会保存文件。但我想使用python

下载文件

requests.get(url)

说无效网址

1 个答案:

答案 0 :(得分:0)

Using Python, how can I access a shared folder on windows network?

使用正斜杠指定UNC路径:

open('//HOST/share/path/to/file')