先進認証
。 # Load the SharePoint Online Client Components SDK from office365.runtime.auth.authentication_context import AuthenticationContext from office365.sharepoint.client_context import ClientContext # Provide the site URL site_url = 'https://<your_ tenant>.sharepoint.com/sites/<your_site>’ # Provide credentials for the service account username = '<service_account_username>’ password = '<service_account_password>’ # Instantiate the authentication context and authenticate ctx_auth = AuthenticationContext(site_url) if ctx_auth.acquire_token_for_user(username, password): # Instantiate the client context and then execute the query ctx = ClientContext(site_url, ctx_auth) ctx.execute_query() # Manipulate the files