小编LKM*_*KMS的帖子

使用 Python 从 OneDrive 下载 Excel 文件会导致文件损坏

我正在尝试从 OneDrive 位置下载 Excel 文件。我的代码可以正常获取文件,但文件已损坏(我收到错误消息):

import urllib2

data = urllib2.urlopen("enter url here")
with open('C:\\Video.xlsx', 'wb') as output:
    output.write(data.read())
output.close()
print "done"
Run Code Online (Sandbox Code Playgroud)

我使用访客访问 Excel 文件,这样我就不必进行身份验证。生成的文件似乎是 15KB,原始文件是 22KB。

python excel sharepoint onedrive

5
推荐指数
2
解决办法
3万
查看次数

标签 统计

excel ×1

onedrive ×1

python ×1

sharepoint ×1