I have got this code's lines:
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()
where 'selected_path' is the path where there is the file I want to download and 'current_working' is the path where I want to save the file. When I run the script, I retrieve this error:
AttributeError: 'tuple' object has no attribute 'read'
The file that I want to download is a GPG crypted file, but I don't think that is this the matter. Sorry for my bad english.
Function
get_file_and_metadata
returns tuple: file and metadata.from here: https://www.dropbox.com/developers/core/start/python
change your call to
self.client.get_file_and_metadata
like this:or just use
get_file
if you dont need the metadata: