![]() ![]() With open('token.pickle', 'wb') as token: ![]() If creds and creds.expired and creds.refresh_token:įlow = om_client_secrets_file( # If there are no (valid) credentials available, let the user log in. With open('token.pickle', 'rb') as token: # created automatically when the authorization flow completes for the first # The file token.pickle stores the user's access and refresh tokens, and is Prints the names and ids of the first 10 files the user has access to. """Shows basic usage of the Drive v3 API. # If modifying these scopes, delete the file token.pickle. from _future_ import print_functionįrom googleapiclient.discovery import buildįrom googleapiclient.http import MediaIoBaseDownloadįrom google_auth_oauthlib.flow import InstalledAppFlowįrom import Request I'm adding the script, from which I removed the file ID and network path. It's not the first python script that I schedule, but I still may be missing something. I repeat, the script on itself works correctly, it just does nothing (and does not return any error) when run through the scheduler. I tried to run it also with the network administrator's account, but to no avail. I suppose it's a matter of permission and authentication, although if run manually, after the first time it retains the authentication details and it works without any popup, so I don't understand why, through a scheduler, it should have problems with permissions. The task seems to work correctly except there is no file in the network folder. bat (which is the one that gets called in the scheduled task). The script works when launched from command line, and it also works when executed from a. I have a python script that downloads a single google spreadsheet as a. Yes I know similar questions have already been answered, but the fact that it has to work as a periodic job (from Windows task scheduler, every night at 21:00) is the point of the question. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |