You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
642 B

import dropbox
# Replace with your access token
ACCESS_TOKEN = 'sl.B-hTaHGCpioPzyC_BVCulhgIP3xTfpTcEgaPwkpzu00j3rgA7Q-9Durd2S1TnA5yqiS_ucn4YcDdyG_VFxropLZiyVPhxd4MiIHpFItugn9DCoMjtiy3Y8lJ6iD2I1A7DAhjlTavVUnxNTc'
# Initialize a Dropbox client
dbx = dropbox.Dropbox(ACCESS_TOKEN)
# Define the folder path
folder_path = '/Filinlämningar/Electric Cars'
# List all files in the root directory
try:
result = dbx.files_list_folder(folder_path)
print(f"Files in the root directory:")
for entry in result.entries:
print(entry.name)
except dropbox.exceptions.ApiError as err:
print(f"Failed to list folder contents: {err}")