以下是dropbox教程中的代码
from dropbox.client import DropboxOAuth2FlowNoRedirect, DropboxClient
from dropbox import rest as dbrest
auth_flow = DropboxOAuth2FlowNoRedirect('r********', 'r***********')
authorize_url = auth_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.')
auth_code = input('Enter the authorization code here: ')
try:
access_token, user_id = auth_flow.finish(auth_code)
except (dbrest.ErrorResponse) as e:
print('Error: %s' % (e,))
c = DropboxClient(access_token)
我得到以下回复
错误:[400]'invalid_client'回溯(最近一次呼叫最后):
文件“test2.py”,第17行,in c = DropboxClient(access_token)NameError:未定义名称“access_token”