使用Dropbox Python库下载文件 [英] Downloading a file using the Dropbox Python library

查看:78
本文介绍了使用Dropbox Python库下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:Windows 7,Visual Studio的Python工具,Python 2.7,Python软件包dropbox(6.9.0),来自我的Dropbox帐户的访问令牌

Environment: Windows 7, Python Tools for Visual Studio, Python 2.7, Python Package dropbox(6.9.0), Access Token from my Dropbox account

以下代码运行:

    import dropbox
    access_token = '<token value here>'
    dbx = dropbox.Dropbox(access_token)

    with open("C:\Test.txt", "w") as f:
        metadata, res = dbx.files_download(path="/Test.txt")
        f.write(res.content)

最后一次出错符合以下条件的行:
没有可用的反汇编

It errors on the last line with the following: "No disassembly available"

我不明白该错误不是Python开发人员。.该文件是在本地创建的

I don't understand the error not being a Python developer.. the file is created on the local machine but nothing is downloaded into it from the dropbox file..

任何帮助将不胜感激。。谢谢

Any help would be greatly appreciated.. Thanks

推荐答案

import dropbox
access_token = '**********************'
dbx = dropbox.Dropbox(access_token)
f = open("ABC.txt","w")                    
metadata,res = dbx.files_download("abc.txt")     //dropbox file path
f.write(res.content)

这篇关于使用Dropbox Python库下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆