Answers for "come collegare python e dropbox"

0

come collegare python e dropbox

#!/usr/bin/env python
import dropbox
class TransferData:
    def __init__(self, access_token):
        self.access_token = access_token
    def upload_file(self, file_from, file_to):
        dbx = dropbox.Dropbox(self.access_token)
        with open(file_from, 'rb') as f:
            dbx.files_upload(f.read(), file_to)

def main():
    access_token = '' # inserisci token qui
    transferData = TransferData(access_token)
    file_from = 'test.txt'
    file_to = '/test_dropbox/test.txt'
    transferData.upload_file(file_from, file_to)
if __name__ == '__main__':
    main()
Posted by: Guest on June-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language