with open("dropbox.txt") as f: app_key,app_secret = f.readlines() app_key,app_secret = app_key.strip(),app_secret.strip() import dropbox flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret) 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 = raw_input("Enter the authorization code here: ").strip() access_token, user_id = flow.finish(code) client = dropbox.client.DropboxClient(access_token) print 'linked account: ', client.account_info()['display_name'] fname = "github-wolverine.jpg" f, metadata = client.get_file_and_metadata('/' + fname) out = open(fname, 'wb') out.write(f.read()) out.close() print metadata['size'] from IPython.core.display import Image Image(filename=fname)