【发布时间】:2013-12-22 21:19:39
【问题描述】:
我得到了这段代码的行:
import dropbox
#some lines for initialize API's
download = self.client.get_file_and_metadata(selected_path)
current_working = os.getcwd()
out = open(current_working+self.filename,'w')
out.write(download.read())
out.close()
其中“selected_path”是我要下载的文件的路径,“current_working”是我要保存文件的路径。 当我运行脚本时,我检索到这个错误:
AttributeError: 'tuple' 对象没有属性 'read'
我要下载的文件是 GPG 加密文件,但我不认为这是问题所在。 对不起我的英语不好。
【问题讨论】:
-
“当我运行脚本时,我得到了这个错误”。 没有。当您运行脚本时,您会得到一个很好的 complete 回溯,而不仅仅是最后一行。如果不是为了帮助您了解正在发生的事情,您为什么认为口译员会为您提供其余信息?那你为什么不在你的问题中复制 full 回溯?
标签: python file download dropbox-api