我使用Dropbox的Python扩展和我收到此错误信息:什么类型错误:“OAuth2FlowNoRedirectResult”的对象是可迭代并不意味着
TypeError: 'OAuth2FlowNoRedirectResult' object is not iterable
这是迄今为止代码:
import dropbox
flow = dropbox.DropboxOAuth2FlowNoRedirect(app_key, app_secret)
# Have the user sign in and authorize this token
authorize_url = flow.start()
print ('1. Go to: ' + authorize_url)
print ('2. Click "Allow" (you might have to log in first)')
print ('3. Copy the authorization code.')
code = input("Enter the authorization code here: ").strip()
# This will fail if the user enters an invalid authorization code
access_token, user_id = flow.finish(code)
f = open('Top Secret.jpg', 'rb')
response = client.put_file('Top Secret.jpg', f)
print ("uploaded:", response)
f.close()
f, metadata = client.get_file_and_metadata('/Top Secret.jpg')
out = open('Test.jpg', 'wb')
out.write(f.read())
out.close()
print (metadata)
我明显的原因排除了应用程序密钥和应用程序秘密。