Downloading a file using the Dropbox Python library

假装没事ソ 提交于 2019-12-11 06:15:48

问题


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

The following code is run:

    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"

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


回答1:


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)


来源:https://stackoverflow.com/questions/39984800/downloading-a-file-using-the-dropbox-python-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!